Thread (42 messages) 42 messages, 9 authors, 2025-09-02

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

From: Keith Busch <kbusch@kernel.org>
Date: 2025-08-20 14:25:35
Also in: linux-fsdevel, linux-xfs, lkml

On Wed, Aug 20, 2025 at 04:02:31PM +0900, Damien Le Moal wrote:
On 8/20/25 1:49 AM, Keith Busch wrote:
quoted
 {
 	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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help