[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250825073539.GA20853@lst.de>
Date: Mon, 25 Aug 2025 09:35:39 +0200
From: Christoph Hellwig <hch@....de>
To: Keith Busch <kbusch@...a.com>
Cc: linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, snitzer@...nel.org, axboe@...nel.dk,
dw@...idwei.uk, brauner@...nel.org, hch@....de,
martin.petersen@...cle.com, djwong@...nel.org,
linux-xfs@...r.kernel.org, viro@...iv.linux.org.uk,
Keith Busch <kbusch@...nel.org>
Subject: Re: [PATCHv3 1/8] block: check for valid bio while splitting
On Tue, Aug 19, 2025 at 09:49:15AM -0700, Keith Busch wrote:
> /*
> * If the queue doesn't support SG gaps and adding this
> * offset would create a gap, disallow it.
> @@ -339,8 +343,16 @@ int bio_split_rw_at(struct bio *bio, const struct queue_limits *lim,
> * Individual bvecs might not be logical block aligned. Round down the
> * split size so that each bio is properly block size aligned, even if
> * we do not use the full hardware limits.
> + *
> + * Misuse may submit a bio that can't be split into a valid io. There
> + * may either be too many discontiguous vectors for the max segments
> + * limit, or contain virtual boundary gaps without having a valid block
> + * sized split. Catch that condition by checking for a zero byte
> + * result.
> */
> bytes = ALIGN_DOWN(bytes, bio_split_alignment(bio, lim));
> + if (!bytes)
If this is just misuse it could be a WARN_ON_ONCE. But I think we
can also trigger this when validating passthrough commands that need
to be built to hardware limits. So maybe don't speak about misuse
here?
Otherwise looks good:
Reviewed-by: Christoph Hellwig <hch@....de>
Powered by blists - more mailing lists