diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-01-26 11:17:08 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-30 13:55:19 +0100 |
commit | 186725a80c4e931b6fe31b94d66c989d5f2354c1 (patch) | |
tree | 95a81e1b42b7b63044c9acc51e3929f0eb7ee77c | |
parent | 54b4c4f9aba9e5d1ef6877f42a57895b189107c9 (diff) | |
download | kernel_replicant_linux-186725a80c4e931b6fe31b94d66c989d5f2354c1.tar.gz kernel_replicant_linux-186725a80c4e931b6fe31b94d66c989d5f2354c1.tar.bz2 kernel_replicant_linux-186725a80c4e931b6fe31b94d66c989d5f2354c1.zip |
io_uring: fix skipping disabling sqo on exec
[ Upstream commit 0b5cd6c32b14413bf87e10ee62be3162588dcbe6 ]
If there are no requests at the time __io_uring_task_cancel() is called,
tctx_inflight() returns zero and and it terminates not getting a chance
to go through __io_uring_files_cancel() and do
io_disable_sqo_submit(). And we absolutely want them disabled by the
time cancellation ends.
Cc: stable@vger.kernel.org # 5.5+
Reported-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Fixes: d9d05217cb69 ("io_uring: stop SQPOLL submit on creator's death")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/io_uring.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 02788fd54357..5018d4928d3e 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -8917,6 +8917,10 @@ void __io_uring_task_cancel(void) /* make sure overflow events are dropped */ atomic_inc(&tctx->in_idle); + /* trigger io_disable_sqo_submit() */ + if (tctx->sqpoll) + __io_uring_files_cancel(NULL); + do { /* read completions before cancelations */ inflight = tctx_inflight(tctx); |