diff options
Diffstat (limited to 'io_uring/rsrc.c')
-rw-r--r-- | io_uring/rsrc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 5dd1e0827559..5fff6ba2b7c0 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -1024,7 +1024,7 @@ static int io_import_fixed(int ddir, struct iov_iter *iter, * and advance us to the beginning. */ offset = buf_addr - imu->ubuf; - iov_iter_bvec(iter, ddir, imu->bvec, imu->nr_bvecs, len); + iov_iter_bvec(iter, ddir, imu->bvec, imu->nr_bvecs, offset + len); if (offset) { /* @@ -1051,6 +1051,7 @@ static int io_import_fixed(int ddir, struct iov_iter *iter, * to use the slow iter advance. */ if (offset < bvec->bv_len) { + iter->count -= offset; iter->iov_offset = offset; } else if (imu->is_kbuf) { iov_iter_advance(iter, offset); @@ -1063,6 +1064,7 @@ static int io_import_fixed(int ddir, struct iov_iter *iter, iter->bvec += seg_skip; iter->nr_segs -= seg_skip; + iter->count -= bvec->bv_len + offset; iter->iov_offset = offset & ((1UL << imu->folio_shift) - 1); } } |