]> git.dujemihanovic.xyz Git - linux.git/commitdiff
io_uring/rsrc: fix incorrect assignment of iter->nr_segs in io_import_fixed
authorChenliang Li <cliang01.li@samsung.com>
Wed, 19 Jun 2024 06:38:19 +0000 (14:38 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 20 Jun 2024 12:51:56 +0000 (06:51 -0600)
In io_import_fixed when advancing the iter within the first bvec, the
iter->nr_segs is set to bvec->bv_len. nr_segs should be the number of
bvecs, plus we don't need to adjust it here, so just remove it.

Fixes: b000ae0ec2d7 ("io_uring/rsrc: optimise single entry advance")
Signed-off-by: Chenliang Li <cliang01.li@samsung.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/20240619063819.2445-1-cliang01.li@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/rsrc.c

index edb9c5baf2e29092fe65341b84a3b06c68a5d1af..570bfa6a31aa93970967f1abc7e2a798efd1f6e6 100644 (file)
@@ -1068,7 +1068,6 @@ int io_import_fixed(int ddir, struct iov_iter *iter,
                         * branch doesn't expect non PAGE_SIZE'd chunks.
                         */
                        iter->bvec = bvec;
-                       iter->nr_segs = bvec->bv_len;
                        iter->count -= offset;
                        iter->iov_offset = offset;
                } else {