From: Pavel Begunkov <asml.silence@gmail.com>
To: stable@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Subject: [PATCH stable 09/11] io_uring: fix skipping disabling sqo on exec
Date: Tue, 26 Jan 2021 11:17:08 +0000 [thread overview]
Message-ID: <4bb1c422df133f0e883fefe221ffc866bfce7aa9.1611659564.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1611659564.git.asml.silence@gmail.com>
[ 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>
---
fs/io_uring.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 12fa5e09cefa..5ead8b6aeda2 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8886,6 +8886,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);
--
2.24.0
next prev parent reply other threads:[~2021-01-26 12:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-26 11:16 [PATCH stable 00/11] io_uring for-stable Pavel Begunkov
2021-01-26 11:17 ` [PATCH stable 01/11] kernel/io_uring: cancel io_uring before task works Pavel Begunkov
2021-01-26 11:17 ` [PATCH stable 02/11] io_uring: inline io_uring_attempt_task_drop() Pavel Begunkov
2021-01-26 11:17 ` [PATCH stable 03/11] io_uring: add warn_once for io_uring_flush() Pavel Begunkov
2021-01-26 11:17 ` [PATCH stable 04/11] io_uring: stop SQPOLL submit on creator's death Pavel Begunkov
2021-01-26 11:17 ` [PATCH stable 05/11] io_uring: fix null-deref in io_disable_sqo_submit Pavel Begunkov
2021-01-26 11:17 ` [PATCH stable 06/11] io_uring: do sqo disable on install_fd error Pavel Begunkov
2021-01-26 11:17 ` [PATCH stable 07/11] io_uring: fix false positive sqo warning on flush Pavel Begunkov
2021-01-26 11:17 ` [PATCH stable 08/11] io_uring: fix uring_flush in exit_files() warning Pavel Begunkov
2021-01-26 11:17 ` Pavel Begunkov [this message]
2021-01-26 11:17 ` [PATCH stable 10/11] io_uring: dont kill fasync under completion_lock Pavel Begunkov
2021-01-26 11:17 ` [PATCH stable 11/11] io_uring: fix sleeping under spin in __io_clean_op Pavel Begunkov
2021-01-26 17:13 ` [PATCH stable 00/11] io_uring for-stable Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4bb1c422df133f0e883fefe221ffc866bfce7aa9.1611659564.git.asml.silence@gmail.com \
--to=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox