mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yu Kuai" <yukuai@fnnas.com>
To: "Kenta Akagi" <k@mgml.me>, "Song Liu" <song@kernel.org>,
	 "Shaohua Li" <shli@fb.com>,
	"Mariusz Tkaczyk" <mtkaczyk@kernel.org>,
	 "Guoqing Jiang" <jgq516@gmail.com>
Cc: <linux-raid@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	 <yukuai@fnnas.com>
Subject: Re: [PATCH v5 03/16] md: add pers->should_error() callback
Date: Thu, 30 Oct 2025 10:24:05 +0800	[thread overview]
Message-ID: <177e7ee6-69c7-4809-86bc-e0a4094a6672@fnnas.com> (raw)
In-Reply-To: <20251027150433.18193-4-k@mgml.me>

Hi,

在 2025/10/27 23:04, Kenta Akagi 写道:
> The failfast feature in RAID1 and RAID10 assumes that when md_error() is
> called, the array remains functional because the last rdev neither fails
> nor sets MD_BROKEN.
>
> However, the current implementation can cause the array to lose
> its last in-sync device or be marked as MD_BROKEN, which breaks the
> assumption and can lead to array failure.
>
> To address this issue, a new handler md_cond_error() will be introduced
> to ensure that failfast I/O does not mark the array as broken.
>
> As preparation, this commit adds a helper pers->should_error() to determine
> from outside the personality whether an rdev can fail safely, which is
> needed by md_cond_error().
>
> Signed-off-by: Kenta Akagi <k@mgml.me>
> ---
>   drivers/md/md.h | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/md/md.h b/drivers/md/md.h
> index c982598cbf97..01c8182431d1 100644
> --- a/drivers/md/md.h
> +++ b/drivers/md/md.h
> @@ -763,6 +763,7 @@ struct md_personality
>   	 * if appropriate, and should abort recovery if needed
>   	 */
>   	void (*error_handler)(struct mddev *mddev, struct md_rdev *rdev);
> +	bool (*should_error)(struct mddev *mddev, struct md_rdev *rdev, struct bio *bio);

I think the name is not quite accurate, perhaps error_handler_check()?

Thanks,
Kuai

>   	int (*hot_add_disk) (struct mddev *mddev, struct md_rdev *rdev);
>   	int (*hot_remove_disk) (struct mddev *mddev, struct md_rdev *rdev);
>   	int (*spare_active) (struct mddev *mddev);

  reply	other threads:[~2025-10-30  2:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-27 15:04 [PATCH v5 00/16] Don't set MD_BROKEN on failfast bio failure Kenta Akagi
2025-10-27 15:04 ` [PATCH v5 01/16] md: move device_lock from conf to mddev Kenta Akagi
2025-10-30  1:59   ` Yu Kuai
2025-10-27 15:04 ` [PATCH v5 02/16] md: serialize md_error() Kenta Akagi
2025-10-30  2:11   ` Yu Kuai
2025-11-06 17:06     ` Kenta Akagi
2025-10-27 15:04 ` [PATCH v5 03/16] md: add pers->should_error() callback Kenta Akagi
2025-10-30  2:24   ` Yu Kuai [this message]
2025-10-27 15:04 ` [PATCH v5 04/16] md: introduce md_cond_error() Kenta Akagi
2025-10-27 15:04 ` [PATCH v5 05/16] md/raid1: implement pers->should_error() Kenta Akagi
2025-10-30  2:31   ` Yu Kuai
2025-10-27 15:04 ` [PATCH v5 06/16] md/raid10: " Kenta Akagi
2025-10-27 15:04 ` [PATCH v5 07/16] md/raid1: refactor handle_read_error() Kenta Akagi
2025-10-30  2:38   ` Yu Kuai
2025-10-27 15:04 ` [PATCH v5 08/16] md/raid10: " Kenta Akagi
2025-10-30  2:39   ` Yu Kuai
2025-10-27 15:04 ` [PATCH v5 09/16] md/raid10: fix failfast read error not rescheduled Kenta Akagi
2025-10-30  2:41   ` Yu Kuai
2025-10-27 15:04 ` [PATCH v5 10/16] md: prevent set MD_BROKEN on super_write failure with failfast Kenta Akagi
2025-10-27 15:04 ` [PATCH v5 11/16] md/raid1: Prevent set MD_BROKEN on failfast bio failure Kenta Akagi
2025-10-27 15:04 ` [PATCH v5 12/16] md/raid10: " Kenta Akagi
2025-10-27 15:04 ` [PATCH v5 13/16] md/raid1: add error message when setting MD_BROKEN Kenta Akagi
2025-10-27 15:04 ` [PATCH v5 14/16] md/raid10: Add " Kenta Akagi
2025-10-27 15:04 ` [PATCH v5 15/16] md: rename 'LastDev' rdev flag to 'RetryingSBWrite' Kenta Akagi
2025-10-27 15:04 ` [PATCH v5 16/16] md: Improve super_written() error logging Kenta Akagi

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=177e7ee6-69c7-4809-86bc-e0a4094a6672@fnnas.com \
    --to=yukuai@fnnas.com \
    --cc=jgq516@gmail.com \
    --cc=k@mgml.me \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mtkaczyk@kernel.org \
    --cc=shli@fb.com \
    --cc=song@kernel.org \
    /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

all inboxes | Powered by JetHome®