From 82218943058d5e3fe692a38b5a549479738dab33 Mon Sep 17 00:00:00 2001 From: Bob Peterson Date: Thu, 21 Jan 2021 10:10:26 -0500 Subject: gfs2: keep bios separate for each journal The recovery func can recover multiple journals, but they were all using the same bio. This resulted in use-after-free related to sdp->sd_log_bio. This patch moves the variable to the journal descriptor, jd, so that every recovery can operate on its own bio. And hopefully we never run out. Signed-off-by: Bob Peterson --- fs/gfs2/lops.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs/gfs2/lops.h') diff --git a/fs/gfs2/lops.h b/fs/gfs2/lops.h index 2280f68862de..9a85b9d7ad60 100644 --- a/fs/gfs2/lops.h +++ b/fs/gfs2/lops.h @@ -20,8 +20,9 @@ extern const struct gfs2_log_operations *gfs2_log_ops[]; extern void gfs2_log_incr_head(struct gfs2_sbd *sdp); extern u64 gfs2_log_bmap(struct gfs2_jdesc *jd, unsigned int lbn); -extern void gfs2_log_write(struct gfs2_sbd *sdp, struct page *page, - unsigned size, unsigned offset, u64 blkno); +extern void gfs2_log_write(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd, + struct page *page, unsigned size, unsigned offset, + u64 blkno); extern void gfs2_log_submit_bio(struct bio **biop, int opf); extern void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh); extern int gfs2_find_jhead(struct gfs2_jdesc *jd, -- cgit v1.2.3