aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2/commit.c
diff options
context:
space:
mode:
authorLogan Gunthorpe <[email protected]>2022-07-27 21:06:00 +0000
committerJens Axboe <[email protected]>2022-08-03 03:08:53 +0000
commit20313b1b8cd1bda34ee136b656c39ff2ae189330 (patch)
tree30c3b19a52812a921535503af1fce64226ed16ff /fs/jbd2/commit.c
parentmd/raid5: Move stripe_request_ctx up (diff)
downloadkernel-20313b1b8cd1bda34ee136b656c39ff2ae189330.tar.gz
kernel-20313b1b8cd1bda34ee136b656c39ff2ae189330.zip
md/raid5: Ensure batch_last is released before sleeping for quiesce
A race condition exists where if raid5_quiesce() is called in the middle of a request that has set batch_last, it will deadlock. batch_last will hold a reference to a stripe when raid5_quiesce() is called. This will cause the next raid5_get_active_stripe() call to sleep waiting for the quiesce to finish, but the raid5_quiesce() thread will wait for active_stripes to go to zero which will never happen because request thread is waiting for the quiesce to stop. Fix this by creating a special __raid5_get_active_stripe() function which takes the request context and clears the last_batch before sleeping. While we're at it, change the arguments of raid5_get_active_stripe() to bools. Fixes: 3312e6c887fe ("md/raid5: Keep a reference to last stripe_head for batch") Reported-by: David Sloan <[email protected]> Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Song Liu <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'fs/jbd2/commit.c')
0 files changed, 0 insertions, 0 deletions