Re: [PATCH v2] block: Fix start and length check added to iov_iter_extract_bvecs()

From: Christoph Hellwig

Date: Mon Sep 07 2026 - 02:18:29 EST


On Sat, Sep 05, 2026 at 05:26:40PM +0100, David Howells wrote:
> Keith Busch <kbusch@xxxxxxxxxx> wrote:
>
> > If a block device behind an RDMA NIC really wants to DMA a single byte
> > at a time, we can't describe that capability today. That would require a
> > 0 mask, which is currently treated as "unset" and overridden with a
> > default 512b mask.
>
> The thing is, Christoph said:
>
> Massage __bio_iov_iter_get_pages so that it doesn't need the bio, and
> move it to lib/iov_iter.c so that it can be used by block code for
> other things than filling a bio and by other subsystems like netfs.
>
> but unless it can have a 1-byte alignment, it's not actually much use for
> netfslib (I have to be able to support "unbuffered writes", which are almost
> exactly like DIO writes but without alignment restrictions).
>
> Do block devices really need an aligned "start memory address" or just an
> aligned "start file position" (whatever that means for a blockdev).

The file position is totally irrelevant, the memory address, or in case
of IOMMUs the IOVA (which keeps the lower bits of the offset aligned)
matter. Most hardware, bother storage and networking (and lots of
others) require at least 4-byte aka DWORD alignment. But if we
want to support event less, we'll need to adjust the interface, which
shouldn't be too horrible.

>
> David
---end quoted text---