On Thu, Jun 18, 2026 at 07:17:35AM -0600, Keith Busch wrote:
> > > if (iov_iter_is_bvec(iter)) {
> > > bio_iov_bvec_set(bio, iter);
> > > +
> > > + if (mp_bvec_iter_offset(bio->bi_io_vec, bio->bi_iter) &
> > > + vec_align_mask)
> > > + return -EINVAL;
> >
> > Can you add a comment here? Especially as the bvec iter doesn't actually
> > require all individual bvecs to be aligned and I'm not entirely sure this
> > handles all case - writing down the rules might help a bit with that.
>
> The rationale is that the only iter_bvec users come from io_uring
> registered buffers, which are virtually contiguous.
There's plenty of iov_iter_bdev users, and even without poking deep I
know that two directly passed on bvecs from block-layer generated bios to
the underlying file system's direct I/O code: loop and zloop.
So we need rules on what can be passed, and preferably some way to
enforce that at least for debug builds.