Re: [PATCHv3 1/8] block: check for valid bio while splitting

From: Keith Busch
Date: Wed Aug 20 2025 - 10:28:03 EST


On Wed, Aug 20, 2025 at 04:02:31PM +0900, Damien Le Moal wrote:
> On 8/20/25 1:49 AM, Keith Busch wrote:
> > {
> > struct bio_vec bv, bvprv, *bvprvp = NULL;
> > struct bvec_iter iter;
> > unsigned nsegs = 0, bytes = 0;
> >
> > bio_for_each_bvec(bv, bio, iter) {
> > + if (bv.bv_offset & lim->dma_alignment || bv.bv_len & len_align)
>
> Shouldn't this be:
>
> if (bv.bv_offset & len_align || bv.bv_len & len_align)
>
> ?

No, we alwqys need to validate the address offset against the dma
alignment. The length is not validated for passthrough commands though,
so different masks for each so they can be independently set.