From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org, martin.petersen@oracle.com
Subject: Re: [PATCH] block: require LBA dma_alignment when using PI
Date: Wed, 22 Oct 2025 08:23:08 -0600 [thread overview]
Message-ID: <aPjozAAE9V-jmqUI@kbusch-mbp> (raw)
In-Reply-To: <20251022083335.2147105-1-hch@lst.de>
On Wed, Oct 22, 2025 at 10:33:31AM +0200, Christoph Hellwig wrote:
> The block layer PI generation / verification code expects the bio_vecs
> to have at least LBA size (or more correctly integrity internal)
> granularity. With the direct I/O alignment relaxation in 2022, user
> space can now feed bios with less alignment than that, leading to
> scribbling outside the PI buffers. Apparently this wasn't noticed so far
> because none of the tests generate such buffers, but since 851c4c96db00
> ("xfs: implement XFS_IOC_DIOINFO in terms of vfs_getattr"), xfstests
> generic/013 by default generates such I/O now that the relaxed alignment
> is advertised by the XFS_IOC_DIOINFO ioctl.
>
> Fix this by increasing the required alignment when using PI, although
> handling arbitrary alignment in the long run would be even nicer.
>
> Fixes: bf8d08532bc1 ("iomap: add support for dma aligned direct-io")
> Fixes: b1a000d3b8ec ("block: relax direct io memory alignment")
Wow! Looks good for now and stable. I agree handling block data across
discontiguous segments is a good plan for after this.
Reviewed-by: Keith Busch <kbusch@kernel.org>
next prev parent reply other threads:[~2025-10-22 14:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-22 8:33 [PATCH] block: require LBA dma_alignment when using PI Christoph Hellwig
2025-10-22 14:23 ` Keith Busch [this message]
2025-10-22 15:53 ` Martin K. Petersen
2025-10-22 16:03 ` Jens Axboe
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=aPjozAAE9V-jmqUI@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--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