From: Yu Kuai <yukuai3@xxxxxxxxxx> This reverts commit 874807a83139abc094f939e93623c5623573d543. Because the deadlock won't exist after commit a214b949d8e3 ("blk-mq: only flush requests from the plug in blk_mq_submit_bio"). And bitmap io is handled asynchronously now, the deadlock won't be triggered anymore. By the way, for performance considerations, plugged bio should not be handled asynchronously. Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx> --- drivers/md/raid1.c | 2 +- drivers/md/raid10.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 7389e599f34e..91e1dbc48228 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1164,7 +1164,7 @@ static void raid1_unplug(struct blk_plug_cb *cb, bool from_schedule) struct r1conf *conf = mddev->private; struct bio *bio; - if (from_schedule || current->bio_list) { + if (from_schedule) { spin_lock_irq(&conf->device_lock); bio_list_merge(&conf->pending_bio_list, &plug->pending); spin_unlock_irq(&conf->device_lock); diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 9f307ff5d4f6..d92b1efe9eee 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1101,7 +1101,7 @@ static void raid10_unplug(struct blk_plug_cb *cb, bool from_schedule) struct r10conf *conf = mddev->private; struct bio *bio; - if (from_schedule || current->bio_list) { + if (from_schedule) { spin_lock_irq(&conf->device_lock); bio_list_merge(&conf->pending_bio_list, &plug->pending); spin_unlock_irq(&conf->device_lock); -- 2.39.2