]> git.baikalelectronics.ru Git - 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:10 +0000 (14:23 +0200)
commit5507678ca98f075d0fe3952b88c819c3634b591b
treea51d119c638e002218544c61674218f2523c06c7
parentd50ad79c521fb1ce34bd87f63b5be267bdd241a8
io_uring: terminate manual loop iterator loop correctly for non-vecs

[ Upstream commit 97dfce5a540dea292d3c10a54249ae359a1ec939 ]

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: fec5b902eb58 ("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>
fs/io_uring.c