Skip to content

Commit d6fef34

Browse files
keithbuschaxboe
authored andcommitted
io_uring: fix off-by one bvec index
If the offset equals the bv_len of the first registered bvec, then the request does not include any of that first bvec. Skip it so that drivers don't have to deal with a zero length bvec, which was observed to break NVMe's PRP list creation. Cc: [email protected] Fixes: bd11b3a ("io_uring: don't use iov_iter_advance() for fixed buffers") Signed-off-by: Keith Busch <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 8479063 commit d6fef34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/rsrc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ int io_import_fixed(int ddir, struct iov_iter *iter,
12581258
*/
12591259
const struct bio_vec *bvec = imu->bvec;
12601260

1261-
if (offset <= bvec->bv_len) {
1261+
if (offset < bvec->bv_len) {
12621262
/*
12631263
* Note, huge pages buffers consists of one large
12641264
* bvec entry and should always go this way. The other

0 commit comments

Comments
 (0)