]> www.infradead.org Git - users/dwmw2/linux.git/commit
io_uring: fix manual setup of iov_iter for fixed buffers
authorAleix Roca Nonell <aleix.rocanonell@bsc.es>
Thu, 15 Aug 2019 12:03:22 +0000 (14:03 +0200)
committerSasha Levin <sashal@kernel.org>
Sun, 25 Aug 2019 14:10:24 +0000 (10:10 -0400)
commitab2fa8b52dc0cfb557515021ec2fa94f5b3826ba
tree765f63b2622b04fff5117c527b1e9f2c24e356f0
parent63e2c0200e4f3d9dbbdefcd32f07f82518a41fda
io_uring: fix manual setup of iov_iter for fixed buffers

commit 99c79f6692ccdc42e04deea8a36e22bb48168a62 upstream.

Commit bd11b3a391e3 ("io_uring: don't use iov_iter_advance() for fixed
buffers") introduced an optimization to avoid using the slow
iov_iter_advance by manually populating the iov_iter iterator in some
cases.

However, the computation of the iterator count field was erroneous: The
first bvec was always accounted for an extent of page size even if the
bvec length was smaller.

In consequence, some I/O operations on fixed buffers were unable to
operate on the full extent of the buffer, consistently skipping some
bytes at the end of it.

Fixes: bd11b3a391e3 ("io_uring: don't use iov_iter_advance() for fixed buffers")
Cc: stable@vger.kernel.org
Signed-off-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c