public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@meta.com>,
	linux-block@vger.kernel.org, martin.petersen@oracle.com,
	axboe@kernel.dk
Subject: Re: [RFC PATCH] blk-integrity: support arbitrary buffer alignment
Date: Wed, 5 Nov 2025 09:28:31 -0700	[thread overview]
Message-ID: <aQt7L4rWnaFT9bsP@kbusch-mbp> (raw)
In-Reply-To: <20251105145309.GA26042@lst.de>

On Wed, Nov 05, 2025 at 03:53:09PM +0100, Christoph Hellwig wrote:
> On Wed, Nov 05, 2025 at 07:42:41AM -0700, Keith Busch wrote:
> > This generally does pass 'void *' to contiguous protection data. If the
> > actual protection payload is spread across multiple segments, though, we
> > don't have contiguous data, so we have to bounce it through something.
> > Declaring the union on the stack provides this memory for that unusual
> > case. If the bip segment is big enough, we point the 'void *' directly
> > at it; if not, we point it to the temporary onstack allocation. Using
> > a union ensures that it's definitely big enough for any checksum type.
> 
> The union contains pointers, which are always 8 bytes.  But I guess
> I can see now how this didn't blow up, assuming this was only tested
> on classic PI, as the tuples are just 8 bytes and you just used the
> pointer as storage?  I.e. these aren't supposed to be pointers, but
> values?

Yeah, should have been values, not pointers. My mistake.

We don't hit the condition that needs the copy buffer with the kernel's
auto-pi, so the bug would never get hit in that path.

I have an io_uring test program that sends pi with offsets such that the
field straddles pages. It does not look like it's hitting any of the ref
tag remapping code though, so still looking into that.

      reply	other threads:[~2025-11-05 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04 22:40 [RFC PATCH] blk-integrity: support arbitrary buffer alignment Keith Busch
2025-11-05 14:15 ` Christoph Hellwig
2025-11-05 14:42   ` Keith Busch
2025-11-05 14:51     ` Keith Busch
2025-11-05 14:53     ` Christoph Hellwig
2025-11-05 16:28       ` Keith Busch [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=aQt7L4rWnaFT9bsP@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kbusch@meta.com \
    --cc=linux-block@vger.kernel.org \
    --cc=martin.petersen@oracle.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