All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 1/1] md: Use pers->quiesce in mddev_suspend
@ 2024-11-05  7:57 Xiao Ni
  2024-11-05  8:14 ` Yu Kuai
  2024-11-05  8:16 ` Mariusz Tkaczyk
  0 siblings, 2 replies; 8+ messages in thread
From: Xiao Ni @ 2024-11-05  7:57 UTC (permalink / raw)
  To: song; +Cc: yukuai3, linux-raid

One customer reports a bug: raid5 is hung when changing thread cnt
while resync is running. The stripes are all in conf->handle_list
and new threads can't handle them.

Commit b39f35ebe86d ("md: don't quiesce in mddev_suspend()") removes
pers->quiesce from mddev_suspend/resume, then we can't guarantee sync
requests finish in suspend operation. One personality knows itself the
best. So pers->quiesce is a proper way to let personality quiesce.

Fixes: b39f35ebe86d ("md: don't quiesce in mddev_suspend()")
Signed-off-by: Xiao Ni <xni@redhat.com>
---
 drivers/md/md.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 67108c397c5a..7409ecb2df68 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -482,6 +482,9 @@ int mddev_suspend(struct mddev *mddev, bool interruptible)
 		return err;
 	}
 
+	if (mddev->pers)
+		mddev->pers->quiesce(mddev, 1);
+
 	/*
 	 * For raid456, io might be waiting for reshape to make progress,
 	 * allow new reshape to start while waiting for io to be done to
@@ -514,6 +517,9 @@ static void __mddev_resume(struct mddev *mddev, bool recovery_needed)
 	percpu_ref_resurrect(&mddev->active_io);
 	wake_up(&mddev->sb_wait);
 
+	if (mddev->pers)
+		mddev->pers->quiesce(mddev, 0);
+
 	if (recovery_needed)
 		set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
 	md_wakeup_thread(mddev->thread);
-- 
2.32.0 (Apple Git-132)


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

end of thread, other threads:[~2024-11-05 10:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-05  7:57 [PATCH RFC 1/1] md: Use pers->quiesce in mddev_suspend Xiao Ni
2024-11-05  8:14 ` Yu Kuai
2024-11-05  8:48   ` Xiao Ni
2024-11-05  8:16 ` Mariusz Tkaczyk
2024-11-05  8:29   ` Yu Kuai
2024-11-05  9:01     ` Xiao Ni
2024-11-05  9:22       ` Yu Kuai
2024-11-05 10:35         ` Xiao Ni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.