]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring: fix CQ waiting timeout handling
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 5 Jan 2023 10:49:15 +0000 (10:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 11:00:46 +0000 (12:00 +0100)
commitb026bb1617ac3d17d91399eb805a7f06493f3d47
tree38697f9340d444dc2a6f7c546864f8d7d59418fb
parent3c09dbaf6ea1a027bfe31d6764be5012d21f297b
io_uring: fix CQ waiting timeout handling

commit 12521a5d5cb7ff0ad43eadfc9c135d86e1131fa8 upstream.

Jiffy to ktime CQ waiting conversion broke how we treat timeouts, in
particular we rearm it anew every time we get into
io_cqring_wait_schedule() without adjusting the timeout. Waiting for 2
CQEs and getting a task_work in the middle may double the timeout value,
or even worse in some cases task may wait indefinitely.

Cc: stable@vger.kernel.org
Fixes: 228339662b398 ("io_uring: don't convert to jiffies for waiting on timeouts")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/f7bffddd71b08f28a877d44d37ac953ddb01590d.1672915663.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/io_uring.c