linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] md/raid10: wake pending freeze in raid10d()
@ 2020-12-31 17:30 Kevin Vigor
  2020-12-31 17:30 ` [PATCH 2/2] md/raid10: introducing range-based barriers Kevin Vigor
  2021-01-18  0:59 ` [PATCH 1/2] md/raid10: wake pending freeze in raid10d() NeilBrown
  0 siblings, 2 replies; 3+ messages in thread
From: Kevin Vigor @ 2020-12-31 17:30 UTC (permalink / raw)
  To: linux-raid; +Cc: Kevin Vigor

The freeze_array() function waits for changes to nr_queued,
but the raid10d() function alters it without sending a wake.

This can lead to freeze_array() never being woken.

Signed-off-by: Kevin Vigor <kvigor@gmail.com>
---
 drivers/md/raid10.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index c5d88ef6a45c..f98df9f084c2 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2698,6 +2698,7 @@ static void raid10d(struct md_thread *thread)
 	struct r10conf *conf = mddev->private;
 	struct list_head *head = &conf->retry_list;
 	struct blk_plug plug;
+	int dequeued = 0;
 
 	md_check_recovery(mddev);
 
@@ -2709,6 +2710,7 @@ static void raid10d(struct md_thread *thread)
 			while (!list_empty(&conf->bio_end_io_list)) {
 				list_move(conf->bio_end_io_list.prev, &tmp);
 				conf->nr_queued--;
+				dequeued++;
 			}
 		}
 		spin_unlock_irqrestore(&conf->device_lock, flags);
@@ -2739,6 +2741,7 @@ static void raid10d(struct md_thread *thread)
 		r10_bio = list_entry(head->prev, struct r10bio, retry_list);
 		list_del(head->prev);
 		conf->nr_queued--;
+		dequeued++;
 		spin_unlock_irqrestore(&conf->device_lock, flags);
 
 		mddev = r10_bio->mddev;
@@ -2762,6 +2765,10 @@ static void raid10d(struct md_thread *thread)
 			md_check_recovery(mddev);
 	}
 	blk_finish_plug(&plug);
+
+	/* in case freeze_array is waiting for changes to nr_queued. */
+	if (conf->array_freeze_pending && dequeued)
+		wake_up(&conf->wait_barrier);
 }
 
 static int init_resync(struct r10conf *conf)
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-18  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-31 17:30 [PATCH 1/2] md/raid10: wake pending freeze in raid10d() Kevin Vigor
2020-12-31 17:30 ` [PATCH 2/2] md/raid10: introducing range-based barriers Kevin Vigor
2021-01-18  0:59 ` [PATCH 1/2] md/raid10: wake pending freeze in raid10d() NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).