Re: [PATCH 15/19] xfs: simplify xfs_buf_submit_bio

Christoph Hellwig
2025-05-02T07:07:47Z

On Thu, May 01, 2025 at 12:51:03PM -0700, Darrick J. Wong wrote:
> > + bio = bio_alloc(bp->b_target->bt_bdev, nr_vecs, xfs_buf_bio_op(bp),
> > + GFP_NOIO);
> > + if (is_vmalloc_addr(bp->b_addr))
> > + bio_add_vmalloc(bio, bp->b_addr, len);
>
> I wonder, do we need a debug assertion on the return value? AFAICT,
> bio_add_max_vecs should result in a bio that's big enough to handle the
> vmalloc area, but those could be famous last words. :P

Buffers are way smaller than the maximum size, but yes error checking
would be nice here. That'll need an error return value or shutdown,
which means changes to the code structure. As the existing code didn't
have that (which happens to be my fault..) I don't want to add it in a
block layer series. I'll add it in the next merge window for future
proofing.