]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: flush timeouts that should already have expired
authorMarcelo Diop-Gonzalez <marcelo827@gmail.com>
Fri, 15 Jan 2021 16:54:40 +0000 (11:54 -0500)
committerJens Axboe <axboe@kernel.dk>
Fri, 15 Jan 2021 17:02:28 +0000 (10:02 -0700)
commit313af776725d7b642a5ce326abde86f9a5251082
treee441b11c2ebe22618a96bb6db65ff88d66fb5753
parent125c91da6f01374611bc8f86c9ea0f5e1c623d7f
io_uring: flush timeouts that should already have expired

Right now io_flush_timeouts() checks if the current number of events
is equal to ->timeout.target_seq, but this will miss some timeouts if
there have been more than 1 event added since the last time they were
flushed (possible in io_submit_flush_completions(), for example). Fix
it by recording the last sequence at which timeouts were flushed so
that the number of events seen can be compared to the number of events
needed without overflow.

Signed-off-by: Marcelo Diop-Gonzalez <marcelo827@gmail.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c