Skip to content

Commit e680a14

Browse files
committed
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
2 parents a578a25 + 2fd7b0f commit e680a14

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/md/raid5.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,13 @@ struct stripe_head *raid5_get_active_stripe(struct r5conf *conf,
854854

855855
set_bit(R5_INACTIVE_BLOCKED, &conf->cache_state);
856856
r5l_wake_reclaim(conf->log, 0);
857+
858+
/* release batch_last before wait to avoid risk of deadlock */
859+
if (ctx && ctx->batch_last) {
860+
raid5_release_stripe(ctx->batch_last);
861+
ctx->batch_last = NULL;
862+
}
863+
857864
wait_event_lock_irq(conf->wait_for_stripe,
858865
is_inactive_blocked(conf, hash),
859866
*(conf->hash_locks + hash));

0 commit comments

Comments
 (0)