diff options
author | Jens Axboe <axboe@kernel.dk> | 2023-10-03 12:26:15 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-10-03 12:26:15 -0600 |
commit | e680a14aec194dfd48e0235dcea656fb32fae75f (patch) | |
tree | b786c0716dfd48329fa5c081a34e72a86258860c | |
parent | a578a25339aca38e23bb5af6e3fc6c2c51f0215c (diff) | |
parent | 2fd7b0f6d5ad655b1d947d3acdd82f687c31465e (diff) | |
download | vfs-e680a14aec194dfd48e0235dcea656fb32fae75f.tar.gz |
Merge tag 'md-fixes-20231003' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-6.6
Pull MD fix from Song.
* tag 'md-fixes-20231003' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md:
md/raid5: release batch_last before waiting for another stripe_head
-rw-r--r-- | drivers/md/raid5.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 4cb9c608ee1919..284cd71bcc685b 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -854,6 +854,13 @@ struct stripe_head *raid5_get_active_stripe(struct r5conf *conf, set_bit(R5_INACTIVE_BLOCKED, &conf->cache_state); r5l_wake_reclaim(conf->log, 0); + + /* release batch_last before wait to avoid risk of deadlock */ + if (ctx && ctx->batch_last) { + raid5_release_stripe(ctx->batch_last); + ctx->batch_last = NULL; + } + wait_event_lock_irq(conf->wait_for_stripe, is_inactive_blocked(conf, hash), *(conf->hash_locks + hash)); |