diff options
author | Bob Peterson <rpeterso@redhat.com> | 2021-01-21 10:10:26 -0500 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2021-01-25 08:08:44 -0500 |
commit | 82218943058d5e3fe692a38b5a549479738dab33 (patch) | |
tree | b61c5d35b664dc8c89c765cf50192da66b7213e7 /fs/gfs2/incore.h | |
parent | f5f02fde9f52b2d769c1c2ddfd3d9c4a1fe739a7 (diff) | |
download | linux-82218943058d5e3fe692a38b5a549479738dab33.tar.bz2 |
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/incore.h')
-rw-r--r-- | fs/gfs2/incore.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 8e1ab8ed4abc..9933af070121 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -531,6 +531,7 @@ struct gfs2_jdesc { unsigned int nr_extents; struct work_struct jd_work; struct inode *jd_inode; + struct bio *jd_log_bio; unsigned long jd_flags; #define JDF_RECOVERY 1 unsigned int jd_jid; @@ -844,7 +845,6 @@ struct gfs2_sbd { struct rw_semaphore sd_log_flush_lock; atomic_t sd_log_in_flight; - struct bio *sd_log_bio; wait_queue_head_t sd_log_flush_wait; int sd_log_error; /* First log error */ wait_queue_head_t sd_withdraw_wait; |