On Tue, Dec 05, 2023 at 09:37:47AM -0700, Keith Busch wrote: > > - if (((bio->bi_iter.bi_size + len) >> SECTOR_SHIFT) > max_sectors) > > + len = min3(len, max_size, queue_max_segment_size(q)); > > + if (len > max_size - bio->bi_iter.bi_size) > > return 0; > > > > if (bio->bi_vcnt > 0) { > > Not related to your patch, but noticed while reviewing: would it not be > beneficial to truncate 'len' down to what can fit in the current-segment > instead of assuming the max segment size? That would be pretty intrusive to the code shared with the normal not hw limited bio add code, so I decided to keep it simple.