diff mbox series

[-next,7/8] md/raid1{,0}: Revert "md/raid1{,0}: fix deadlock in bitmap_unplug."

Message ID 20230420112946.2869956-8-yukuai1@huaweicloud.com (mailing list archive)
State New, archived
Delegated to: Song Liu
Headers show
Series md/raid1-10: limit the number of plugged bio | expand

Commit Message

Yu Kuai April 20, 2023, 11:29 a.m. UTC
From: Yu Kuai <yukuai3@huawei.com>

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@huawei.com>
---
 drivers/md/raid1.c  | 2 +-
 drivers/md/raid10.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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);