DM-Devel Archive mirror
 help / color / mirror / Atom feed
From: Xiao Ni <xni@redhat.com>
To: song@kernel.org
Cc: yukuai1@huaweicloud.com, bmarzins@redhat.com, heinzm@redhat.com,
	snitzer@kernel.org, ncroxon@redhat.com,
	linux-raid@vger.kernel.org, dm-devel@lists.linux.dev
Subject: [PATCH 2/6] md: Revert "md: Make sure md_do_sync() will set MD_RECOVERY_DONE"
Date: Thu, 29 Feb 2024 23:49:37 +0800	[thread overview]
Message-ID: <20240229154941.99557-3-xni@redhat.com> (raw)
In-Reply-To: <20240229154941.99557-1-xni@redhat.com>

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@redhat.com>
---
 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)


  parent reply	other threads:[~2024-02-29 15:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 15:49 [PATCH 0/6] Fix dmraid regression bugs Xiao Ni
2024-02-29 15:49 ` [PATCH 1/6] md: Revert "md: Don't register sync_thread for reshape directly" Xiao Ni
2024-03-01  2:38   ` Yu Kuai
2024-03-01  4:41     ` Xiao Ni
2024-02-29 15:49 ` Xiao Ni [this message]
2024-02-29 22:53   ` [PATCH 2/6] md: Revert "md: Make sure md_do_sync() will set MD_RECOVERY_DONE" Song Liu
2024-02-29 23:45     ` Song Liu
2024-03-01  0:49       ` Xiao Ni
2024-03-01  1:11         ` Song Liu
2024-02-29 15:49 ` [PATCH 3/6] md: Revert "md: Don't ignore suspended array in md_check_recovery()" Xiao Ni
2024-02-29 15:49 ` [PATCH 4/6] dm-raid/md: Clear MD_RECOVERY_WAIT when stopping dmraid Xiao Ni
2024-03-01  2:44   ` Yu Kuai
2024-03-01  4:19     ` Xiao Ni
2024-02-29 15:49 ` [PATCH 5/6] md: Set MD_RECOVERY_FROZEN before stop sync thread Xiao Ni
2024-02-29 15:49 ` [PATCH 6/6] md/raid5: Don't check crossing reshape when reshape hasn't started Xiao Ni
2024-02-29 19:39 ` [PATCH 0/6] Fix dmraid regression bugs Christoph Hellwig
2024-02-29 19:45   ` Song Liu
2024-03-01  2:12 ` Yu Kuai
2024-03-01  2:22   ` Xiao Ni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240229154941.99557-3-xni@redhat.com \
    --to=xni@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=heinzm@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=ncroxon@redhat.com \
    --cc=snitzer@kernel.org \
    --cc=song@kernel.org \
    --cc=yukuai1@huaweicloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).