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

Christoph Hellwig <[email protected]>
Newsgroups org.kernel.vger.linux-bcache,dev.linux.lists.dm-devel,dev.linux.lists.gfs2,org.kernel.vger.linux-block,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-pm,org.kernel.vger.linux-xfs
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.