]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
io_uring: terminate manual loop iterator loop correctly for non-vecs
authorJens Axboe <axboe@kernel.dk>
Fri, 18 Mar 2022 17:28:13 +0000 (11:28 -0600)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:57:00 +0000 (11:57 +0200)
commit08faab719958d004160c327ea9e56ef89f53b56a
treee07a87bb5881d62f2233901748bdb56df696c708
parent37f2aa162c4dd56d02ff7f40feb2b2c8ab96d6a2
io_uring: terminate manual loop iterator loop correctly for non-vecs

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit 5e929367468c8f97cd1ffb0417316cecfebef94b ]

The fix for not advancing the iterator if we're using fixed buffers is
broken in that it can hit a condition where we don't terminate the loop.
This results in io-wq looping forever, asking to read (or write) 0 bytes
for every subsequent loop.

Reported-by: Joel Jaeschke <joel.jaeschke@gmail.com>
Link: https://github.com/axboe/liburing/issues/549
Fixes: 16c8d2df7ec0 ("io_uring: ensure symmetry in handling iter types in loop_rw_iter()")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 109dda45102112799e507a65e375ebb096d3ae49)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/io_uring.c