diff --git a/fs/io_uring.c b/fs/io_uring.c index 5ea7650b74eb..fa1c6e7b3c30 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3440,13 +3440,15 @@ static ssize_t loop_rw_iter(int rw, struct io_kiocb *req, struct iov_iter *iter) ret = nr; break; } + ret += nr; if (!iov_iter_is_bvec(iter)) { iov_iter_advance(iter, nr); } else { - req->rw.len -= nr; req->rw.addr += nr; + req->rw.len -= nr; + if (!req->rw.len) + break; } - ret += nr; if (nr != iovec.iov_len) break; }