linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yu Kuai <yukuai1@huaweicloud.com>
To: linan666@huaweicloud.com, song@kernel.org, neil@brown.name,
	namhyung@gmail.com
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
	yangerkun@huawei.com, yi.zhang@huawei.com,
	"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH 3/7] md: cleanup MD_RECOVERY_ERROR flag
Date: Thu, 25 Sep 2025 16:50:54 +0800	[thread overview]
Message-ID: <d8b4e30a-c711-f5b4-4c48-3c8a7e62c85f@huaweicloud.com> (raw)
In-Reply-To: <20250917093508.456790-4-linan666@huaweicloud.com>

Hi,

在 2025/09/17 17:35, linan666@huaweicloud.com 写道:
> From: Li Nan <linan122@huawei.com>
> 
> The MD_RECOVERY_ERROR flag prevented bad sectors from updating
> 'resync_offset' when badblocks failed to set during sync errors.
> Now that failure to set badblocks definitively marks the disk as
> Faulty, this flag is redundant. In both scenarios (successful
> badblock marking or disk fault), the bad sectors becomes unreadable
> and its handling is considered completed.
> 
> Signed-off-by: Li Nan <linan122@huawei.com>
> ---
>   drivers/md/md.h |  2 --
>   drivers/md/md.c | 22 ++++------------------
>   2 files changed, 4 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/md/md.h b/drivers/md/md.h
> index ba567b63afd3..07a22f3772d8 100644
> --- a/drivers/md/md.h
> +++ b/drivers/md/md.h
> @@ -644,8 +644,6 @@ enum recovery_flags {
>   	MD_RECOVERY_FROZEN,
>   	/* waiting for pers->start() to finish */
>   	MD_RECOVERY_WAIT,
> -	/* interrupted because io-error */
> -	MD_RECOVERY_ERROR,
>   
>   	/* flags determines sync action, see details in enum sync_action */
>   
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 05b6b3145648..c4d765d57af7 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -8949,7 +8949,6 @@ void md_sync_error(struct mddev *mddev)
>   {
>   	// stop recovery, signal do_sync ....
>   	set_bit(MD_RECOVERY_INTR, &mddev->recovery);
> -	set_bit(MD_RECOVERY_ERROR, &mddev->recovery);
>   	md_wakeup_thread(mddev->thread);
>   }
>   EXPORT_SYMBOL(md_sync_error);
> @@ -9598,7 +9597,6 @@ void md_do_sync(struct md_thread *thread)
>   	wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active));
>   
>   	if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) &&
> -	    !test_bit(MD_RECOVERY_INTR, &mddev->recovery) &&

Not sure why this is removed, otherwise LGTM.

Thanks,
Kuai

>   	    mddev->curr_resync >= MD_RESYNC_ACTIVE) {
>   		mddev->curr_resync_completed = mddev->curr_resync;
>   		sysfs_notify_dirent_safe(mddev->sysfs_completed);
> @@ -9607,24 +9605,12 @@ void md_do_sync(struct md_thread *thread)
>   
>   	if (!test_bit(MD_RECOVERY_CHECK, &mddev->recovery) &&
>   	    mddev->curr_resync > MD_RESYNC_ACTIVE) {
> +		if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery))
> +			mddev->curr_resync = MaxSector;
> +
>   		if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
> -			if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
> -				if (mddev->curr_resync >= mddev->resync_offset) {
> -					pr_debug("md: checkpointing %s of %s.\n",
> -						 desc, mdname(mddev));
> -					if (test_bit(MD_RECOVERY_ERROR,
> -						&mddev->recovery))
> -						mddev->resync_offset =
> -							mddev->curr_resync_completed;
> -					else
> -						mddev->resync_offset =
> -							mddev->curr_resync;
> -				}
> -			} else
> -				mddev->resync_offset = MaxSector;
> +			mddev->resync_offset = mddev->curr_resync;
>   		} else {
> -			if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery))
> -				mddev->curr_resync = MaxSector;
>   			if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) &&
>   			    test_bit(MD_RECOVERY_RECOVER, &mddev->recovery)) {
>   				rcu_read_lock();
> 


  reply	other threads:[~2025-09-25  8:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17  9:35 [PATCH 0/7] cleanup and bugfix of sync linan666
2025-09-17  9:35 ` [PATCH 1/7] md: factor error handling out of md_done_sync into helper linan666
2025-09-22  1:24   ` Yu Kuai
2025-09-17  9:35 ` [PATCH 2/7] md: mark rdev Faulty when badblocks setting fails linan666
2025-09-22  2:01   ` Li Nan
2025-09-17  9:35 ` [PATCH 3/7] md: cleanup MD_RECOVERY_ERROR flag linan666
2025-09-25  8:50   ` Yu Kuai [this message]
2025-09-17  9:35 ` [PATCH 4/7] md: factor out sync completion update into helper linan666
2025-09-25  9:00   ` Yu Kuai
2025-09-17  9:35 ` [PATCH 5/7] md/raid10: fix any_working flag handling in raid10_sync_request linan666
2025-09-25  9:01   ` Yu Kuai
2025-09-17  9:35 ` [PATCH 6/7] md/raid10: cleanup skip " linan666
2025-09-17  9:35 ` [PATCH 7/7] md: remove recovery_disabled linan666

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=d8b4e30a-c711-f5b4-4c48-3c8a7e62c85f@huaweicloud.com \
    --to=yukuai1@huaweicloud.com \
    --cc=linan666@huaweicloud.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=namhyung@gmail.com \
    --cc=neil@brown.name \
    --cc=song@kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.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 NNTP newsgroup(s).