]> www.infradead.org Git - users/jedix/linux-maple.git/commit
block: fix queue limits checks in blk_rq_map_user_bvec for real
authorChristoph Hellwig <hch@lst.de>
Mon, 28 Oct 2024 09:07:48 +0000 (10:07 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 28 Oct 2024 18:35:05 +0000 (12:35 -0600)
commitbe0e822bb3f5259c7f9424ba97e8175211288813
treea511e2122de81f69746a2d041a860d65bd0e71ad
parent2ff949441802a8d076d9013c7761f63e8ae5a9bd
block: fix queue limits checks in blk_rq_map_user_bvec for real

blk_rq_map_user_bvec currently only has ad-hoc checks for queue limits,
and the last fix to it enabled valid NVMe I/O to pass, but also allowed
invalid one for drivers that set a max_segment_size or seg_boundary
limit.

Fix it once for all by using the bio_split_rw_at helper from the I/O
path that indicates if and where a bio would be have to be split to
adhere to the queue limits, and it returns a positive value, turn that
into -EREMOTEIO to retry using the copy path.

Fixes: 2ff949441802 ("block: fix sanity checks in blk_rq_map_user_bvec")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20241028090840.446180-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-map.c