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.

Signed-off-by: Mikulas Patocka <mpato...@redhat.com>
Fixes: f52f5c71f3d4 ("md: fix stopping sync thread")
Cc: sta...@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) {


Reply via email to