Thread (34 messages) 34 messages, 5 authors, 2024-01-27

Re: [PATCH 4/7] md: call md_reap_sync_thread from __md_stop_writes

From: Yu Kuai <hidden>
Date: 2024-01-18 01:38:29
Also in: dm-devel

Hi,

在 2024/01/18 2:20, Mikulas Patocka 写道:
The commit f52f5c71f3d4 ("md: fix stopping sync thread") breaks the LVM2
test shell/lvconvert-raid-reshape-linear_to_raid6-single-type.sh

There are many places that test for MD_RECOVERY_RUNNING or
mddev->sync_thread. If we don't reap the thread, they would be confused.
Please stop this... make sure you understand the lifetime of
sync_thread before you send such patch. I already explained in
f52f5c71f3d4 why md_reap_sync_thread() can't be called here.

Thanks,
Kuai
quoted hunk ↗ jump to hunk
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: f52f5c71f3d4 ("md: fix stopping sync thread")
Cc: stable@vger.kernel.org	# v6.7

---
  drivers/md/md.c |    6 ++++++
  1 file changed, 6 insertions(+)

Index: linux-2.6/drivers/md/md.c
===================================================================
--- linux-2.6.orig/drivers/md/md.c
+++ linux-2.6/drivers/md/md.c
@@ -6308,6 +6308,12 @@ static void md_clean(struct mddev *mddev
  static void __md_stop_writes(struct mddev *mddev)
  {
  	stop_sync_thread(mddev, true, false);
+
+	if (mddev->sync_thread) {
+		set_bit(MD_RECOVERY_INTR, &mddev->recovery);
+		md_reap_sync_thread(mddev);
+	}
+
  	del_timer_sync(&mddev->safemode_timer);
  
  	if (mddev->pers && mddev->pers->quiesce) {
.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help