diff options
author | Bob Peterson <rpeterso@redhat.com> | 2021-01-21 16:10:26 +0100 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2021-01-25 14:08:44 +0100 |
commit | 82218943058d5e3fe692a38b5a549479738dab33 (patch) | |
tree | b61c5d35b664dc8c89c765cf50192da66b7213e7 /fs/gfs2/log.c | |
parent | gfs2: fix glock confusion in function signal_our_withdraw (diff) | |
download | linux-82218943058d5e3fe692a38b5a549479738dab33.tar.xz linux-82218943058d5e3fe692a38b5a549479738dab33.zip |
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 <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/log.c')
-rw-r--r-- | fs/gfs2/log.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 41d13f19d1b4..d3fa14ec2c44 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -822,8 +822,8 @@ void gfs2_write_log_header(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd, sb->s_blocksize - LH_V1_SIZE - 4); lh->lh_crc = cpu_to_be32(crc); - gfs2_log_write(sdp, page, sb->s_blocksize, 0, dblock); - gfs2_log_submit_bio(&sdp->sd_log_bio, REQ_OP_WRITE | op_flags); + gfs2_log_write(sdp, jd, page, sb->s_blocksize, 0, dblock); + gfs2_log_submit_bio(&jd->jd_log_bio, REQ_OP_WRITE | op_flags); out: log_flush_wait(sdp); } @@ -999,7 +999,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl, u32 flags) lops_before_commit(sdp, tr); if (gfs2_withdrawn(sdp)) goto out_withdraw; - gfs2_log_submit_bio(&sdp->sd_log_bio, REQ_OP_WRITE); + gfs2_log_submit_bio(&sdp->sd_jdesc->jd_log_bio, REQ_OP_WRITE); if (gfs2_withdrawn(sdp)) goto out_withdraw; |