Re: [PATCH v4 8/9] md/raid1,raid10: set IO_BLOCKED in case of BLK_STS_P2PDMA
From: Logan Gunthorpe
Date: Wed Jul 22 2026 - 23:18:02 EST
On 2026-07-22 12:58 p.m., Mykola Marzhan wrote:
> From: Logan Gunthorpe <logang@xxxxxxxxxxxx>
>
> A read that fails with BLK_STS_P2PDMA cannot succeed against that
> member, so mark the leg IO_BLOCKED and let the retry redirect elsewhere.
> Skip the read-error machinery: there is nothing on the medium to fix,
> fix_read_error()'s probe reads into host pages and would "succeed", and
> charging the read-error budget would evict a healthy member under a P2P
> read workload. FailFast eviction is skipped for the same reason -- the
> request never reached the wire.
>
> Fixes: 02666132403a ("md: propagate BLK_FEAT_PCI_P2PDMA from member devices to RAID device")
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Logan Gunthorpe <logang@xxxxxxxxxxxx>
> Co-developed-by: Mykola Marzhan <mykola@xxxxxxxxxxx>
> Signed-off-by: Mykola Marzhan <mykola@xxxxxxxxxxx>
> ---
> drivers/md/raid1.c | 4 +++-
> drivers/md/raid10.c | 5 ++++-
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index 917d694ef401..76a1426e64f0 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -2658,6 +2658,8 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio)
> {
> struct md_rdev *rdev = conf->mirrors[r1_bio->read_disk].rdev;
> struct bio *bio = r1_bio->bios[r1_bio->read_disk];
> + /* evaluate before the bio_put() below */
> + bool p2pdma_error = bio->bi_status == BLK_STS_P2PDMA;
Sorry, I had one late nit-picky thought tonight I thought I'd suggest:
It might be better to store bi_status in a local variable instead of the
much more specific p2pdma_error value. I think this would read a lot
better, make the intent a little more clear and be reusable if other
bi_status conditions need to be handled specially.
Thanks,
Logan