]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ublk: move offset check out of __ublk_check_and_get_req()
authorCaleb Sander Mateos <csander@purestorage.com>
Thu, 8 Jan 2026 09:19:36 +0000 (02:19 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 12 Jan 2026 16:16:33 +0000 (09:16 -0700)
commitfd5a005fa6a261762292a2d89ef8d0174b66f541
treee789997d58a95e68500572d56b7e1d9ba685d943
parentca80afd8708fa22f6d3a1e0306ae12a64e5291b5
ublk: move offset check out of __ublk_check_and_get_req()

__ublk_check_and_get_req() checks that the passed in offset is within
the data length of the specified ublk request. However, only user copy
(ublk_check_and_get_req()) supports accessing ublk request data at a
nonzero offset. Zero-copy buffer registration (ublk_register_io_buf())
always passes 0 for the offset, so the check is unnecessary. Move the
check from __ublk_check_and_get_req() to ublk_check_and_get_req().

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c