This reverts commit 82ec0ae59d02e89164b24c0cc8e4e50de78b5fd6. The root cause is that MD_RECOVERY_WAIT isn't cleared when stopping raid. The following patch 'Clear MD_RECOVERY_WAIT when stopping dmraid' fixes this problem. Signed-off-by: Xiao Ni <xni@xxxxxxxxxx> --- drivers/md/md.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index db4743ba7f6c..6376b1aad4d9 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -8792,16 +8792,12 @@ void md_do_sync(struct md_thread *thread) int ret; /* just incase thread restarts... */ - if (test_bit(MD_RECOVERY_DONE, &mddev->recovery)) + if (test_bit(MD_RECOVERY_DONE, &mddev->recovery) || + test_bit(MD_RECOVERY_WAIT, &mddev->recovery)) return; - - if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) - goto skip; - - if (test_bit(MD_RECOVERY_WAIT, &mddev->recovery) || - !md_is_rdwr(mddev)) {/* never try to sync a read-only array */ + if (!md_is_rdwr(mddev)) {/* never try to sync a read-only array */ set_bit(MD_RECOVERY_INTR, &mddev->recovery); - goto skip; + return; } if (mddev_is_clustered(mddev)) { -- 2.32.0 (Apple Git-132)