On Tue, Jun 23, 2026 at 05:10:21PM +0200, Christoph Hellwig wrote: > > + /* > > + * The vectors are owned and laid out by the caller; we only forward > > + * them. Most callers are already aligned, but io_uring can place a > > + * user chosen offset through a registered buffer, where only the first > > + * vector may be unaligned. > > + */ > > + return !(mp_bvec_iter_offset(bio->bi_io_vec, bio->bi_iter) & > > + mem_align_mask); > > I don't fully understand the comment. I guess this is to say ITER_BVEC > users better don't create any alignment gaps? Maybe we should also > clearly document that in uio.h?
Exactly, the in-kernel users of ITER_BVEC that allocate their own buffers are, as far as I know, aligned already. Fabric storage targets like nvme allocate their own SGLs on page boundaries so the bio is aligned at the point it was constructed. The ones that forward user buffers like loop and zloop are addressed in the previous two patches. They generally should have been fine for most hardware without those updates, but they're included in case a backing device has more restrictive constraints than 512b "sector_t" aligned. The only other user space provided alignment that I think may trip this up is the io_uring registered buffer, so that's what I'm trying to call out here.
