On Mon, Apr 08, 2024 at 10:47:39AM +0200, Christoph Hellwig wrote: > On Mon, Apr 08, 2024 at 03:36:50PM +0800, Ming Lei wrote: > > It isn't now we put the limit, and this way has been done for stacking device > > since beginning, it is actually added by commit d690cb8ae14b in v6.9-rc1. > > > > If max segment size isn't aligned with virt_boundary_mask, bio_split_rw() > > will split the bio with max segment size, this way still works, just not > > efficiently. And in reality, the two are often aligned. > > We've had real bugs due to this, which is why we have the check. We also > had a warning before the commit, it's just it got skipped for > stacking. So even if we want to return to the broken pre-6.9-rc behavior > it should only be for stacking. I don't think that is a good outcome, > though. The limit is from commit 09324d32d2a0 ("block: force an unlimited segment size on queues with a virt boundary") which claims to fix f6970f83ef79 ("block: don't check if adjacent bvecs in one bio can be mergeable"). However commit f6970f83ef79 only covers merge code which isn't used by bio driver at all, so not sure pre-6.9-rc is broken for stacking driver. Also commit 09324d32d2a0 mentioned that it did not cause problem, actually 64K default segment size limits always exists even though the device doesn't provide one, so looks there isn't report as 'real bugs', or maybe I miss something? commit 09324d32d2a0843e66652a087da6f77924358e62 Author: Christoph Hellwig <hch@xxxxxx> Date: Tue May 21 09:01:41 2019 +0200 block: force an unlimited segment size on queues with a virt boundary We currently fail to update the front/back segment size in the bio when deciding to allow an otherwise gappy segement to a device with a virt boundary. The reason why this did not cause problems is that devices with a virt boundary fundamentally don't use segments as we know it and thus don't care. Make that assumption formal by forcing an unlimited segement size in this case. Fixes: f6970f83ef79 ("block: don't check if adjacent bvecs in one bio can be mergeable") Signed-off-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx> Reviewed-by: Hannes Reinecke <hare@xxxxxxxx> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Thanks, Ming