From: Mike Snitzer <snitzer@kernel.org>
To: Keith Busch <kbusch@kernel.org>, axboe@kernel.dk
Cc: Mikulas Patocka <mpatocka@redhat.com>,
Benjamin Marzinski <bmarzins@redhat.com>,
Keith Busch <kbusch@meta.com>,
dm-devel@lists.linux.dev, linux-block@vger.kernel.org,
"Dr. David Alan Gilbert" <linux@treblig.org>,
Vjaceslavs Klimovs <vklimovs@gmail.com>
Subject: Re: [PATCH 2/2] dm-raid1: don't fail the mirror for invalid I/O errors
Date: Tue, 7 Jul 2026 15:44:54 -0400 [thread overview]
Message-ID: <ak1XNlyFC34W47iP@kernel.org> (raw)
In-Reply-To: <akwVkSnXtyl6rBdh@kbusch-mbp>
On Mon, Jul 06, 2026 at 02:52:33PM -0600, Keith Busch wrote:
> On Wed, Jun 24, 2026 at 01:14:03PM +0200, Mikulas Patocka wrote:
> > This approach is OK, I will stage the patches when 7.2-rc1 comes out and
> > when I'll fork the dm git branches.
> >
> > I suggest one change - it is kind of hacky when multiple I/O completion
> > callbacks write into io->orig_bio->bi_status concurrently - so it would be
> > better to not do it and maintain and return separate bit mask for
> > non-retryable errors.
> >
> > For example:
> >
> > static void complete_io(struct io *io)
> > {
> > unsigned long error_bits = io->error_bits;
> > unsigned long nonretryable_error_bits = io->nonretryable_error_bits;
> > io_notify_fn fn = io->callback;
> > void *context = io->context;
> >
> > if (io->vma_invalidate_size)
> > invalidate_kernel_vmap_range(io->vma_invalidate_address,
> > io->vma_invalidate_size);
> >
> > mempool_free(io, &io->client->pool);
> > fn(error_bits, nonretryable_error_bits, context);
> > }
> >
> > static void dec_count(struct io *io, unsigned int region, blk_status_t error)
> > {
> > if (unlikely(error == BLK_STS_NOTSUPP) || unlikely(error == BLK_STS_INVAL))
> > set_bit(region, &io->nonretryable_error_bits);
> > else if (unlikely(error != BLK_STS_OK))
> > set_bit(region, &io->error_bits);
> >
> > if (atomic_dec_and_test(&io->count))
> > complete_io(io);
> > }
> >
> > Please send the updated patch that uses this approach.
>
> Sure thing, I can get started on that. Though I think it's largely
> obviated if we get the block layer to handle things early rather than
> submit malformed bio's, and this will accomplish that:
>
> https://lore.kernel.org/dm-devel/20260624170905.3972095-1-kbusch@meta.com/
Jens hasn't picked that series up yet. Jens?
> But I can certainly respin this series as it provides a more indepth
> defence.
>
> I also owe an update on the relaxed dm-crypt direct-io memory alignment
> as well, as that series fell through the cracks on me for the previous
> merge window.
So where does dm-raid1 and dm-crypt stand relative to these DIO memory
alignment changes? Inferring they are pretty exposed.
> > BTW. I think that blk_path_error should also test for BLK_STS_INVAL and
> > return false, otherwise, dm-multipath would be suffering from this bug
> > too. Ben, could you test it?
>
> Good point.
Would appreciate knowing if multipath exposed too.
Thanks,
Mike
next prev parent reply other threads:[~2026-07-07 19:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 15:05 [PATCH 1/2] dm-io: clone the source bio instead of copying its biovec Keith Busch
2026-06-16 15:05 ` [PATCH 2/2] dm-raid1: don't fail the mirror for invalid I/O errors Keith Busch
2026-06-16 17:54 ` Dr. David Alan Gilbert
2026-06-16 18:48 ` Keith Busch
2026-06-16 20:09 ` Dr. David Alan Gilbert
2026-06-16 23:45 ` Keith Busch
2026-06-16 23:47 ` Dr. David Alan Gilbert
2026-06-17 15:08 ` Keith Busch
2026-06-17 15:33 ` Dr. David Alan Gilbert
2026-06-17 16:21 ` Keith Busch
2026-06-17 16:44 ` Dr. David Alan Gilbert
2026-06-17 16:54 ` Keith Busch
2026-06-17 16:59 ` Dr. David Alan Gilbert
2026-06-19 2:07 ` Vjaceslavs Klimovs
2026-06-16 15:40 ` Keith Busch
2026-06-16 15:58 ` Keith Busch
2026-06-24 11:14 ` Mikulas Patocka
2026-07-06 20:52 ` Keith Busch
2026-07-07 19:44 ` Mike Snitzer [this message]
2026-07-08 17:57 ` Keith Busch
2026-07-08 23:24 ` Benjamin Marzinski
2026-07-09 16:13 ` Benjamin Marzinski
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=ak1XNlyFC34W47iP@kernel.org \
--to=snitzer@kernel.org \
--cc=axboe@kernel.dk \
--cc=bmarzins@redhat.com \
--cc=dm-devel@lists.linux.dev \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
--cc=linux-block@vger.kernel.org \
--cc=linux@treblig.org \
--cc=mpatocka@redhat.com \
--cc=vklimovs@gmail.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