public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
From: "Yu Kuai" <yukuai@fnnas.com>
To: "Keith Busch" <kbusch@meta.com>, <linux-raid@vger.kernel.org>,
	 <song@kernel.org>
Cc: linan122@huawei.com, axboe@kernel.dk,
	"Keith Busch" <kbusch@kernel.org>, "Tomáš Trnka" <trnka@scm.com>,
	yukuai@fnnas.com
Subject: Re: [PATCH] md/raid1,raid10: don't fail devices for invalid IO errors
Date: Sun, 19 Apr 2026 13:26:28 +0800	[thread overview]
Message-ID: <fd07b6bb-a277-4984-a449-11c9bfc40436@fnnas.com> (raw)
In-Reply-To: <20260416140345.3872265-1-kbusch@meta.com>

在 2026/4/16 22:03, Keith Busch 写道:

> From: Keith Busch<kbusch@kernel.org>
>
> BLK_STS_INVAL indicates the IO request itself was invalid, not that the
> device has failed. When raid1 treats this as a device error, it retries
> on alternate mirrors which fail the same way, eventually exceeding the
> read error threshold and removing the device from the array.
>
> This happens when stacking configurations bypass bio_split_to_limits()
> in the IO path: dm-raid calls md_handle_request() directly without going
> through md_submit_bio(), skipping the alignment validation that would
> otherwise reject invalid bios early. The invalid bio reaches the
> lower block layers, which fail the bio with  BLK_STS_INVAL, and raid1
> wrongly interprets this as a device failure.
>
> Add BLK_STS_INVAL to raid1_should_handle_error() so that invalid IO
> errors are propagated back to the caller rather than triggering device
> removal. This is consistent with the previous kernel behavior when
> alignment checks were done earlier in the direct-io path.
>
> Fixes: 5ff3f74e145adc7 ("block: simplify direct io validity check")
> Link:https://lore.kernel.org/linux-block/2982107.4sosBPzcNG@electra/
> Reported-by: Tomáš Trnka<trnka@scm.com>
> Signed-off-by: Keith Busch<kbusch@kernel.org>
> ---
>   drivers/md/raid1-10.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
Applied

-- 
Thansk,
Kuai

      parent reply	other threads:[~2026-04-19  5:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 14:03 [PATCH] md/raid1,raid10: don't fail devices for invalid IO errors Keith Busch
2026-04-17  8:01 ` Tomáš Trnka
2026-04-19  5:26 ` Yu Kuai [this message]

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=fd07b6bb-a277-4984-a449-11c9bfc40436@fnnas.com \
    --to=yukuai@fnnas.com \
    --cc=axboe@kernel.dk \
    --cc=kbusch@kernel.org \
    --cc=kbusch@meta.com \
    --cc=linan122@huawei.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    --cc=trnka@scm.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