]> www.infradead.org Git - nvme.git/commit
io_uring/rsrc: ensure segments counts are correct on kbuf buffers
authorJens Axboe <axboe@kernel.dk>
Wed, 16 Apr 2025 22:48:26 +0000 (16:48 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Apr 2025 17:59:12 +0000 (11:59 -0600)
commitb419bed4f0a62c65a57dd495185821dd56bc435c
tree5990977344f44446681900c2b1b6e9d0a1ef748a
parent80c7378f94cf193cb3bd2101bbcd5aea78d0e211
io_uring/rsrc: ensure segments counts are correct on kbuf buffers

kbuf imports have the front offset adjusted and segments removed, but
the tail segments are still included in the segment count that gets
passed in the iov_iter. As the segments aren't necessarily all the
same size, move importing to a separate helper and iterate the
mapped length to get an exact count.

Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/rsrc.c