Skip to content

Commit 186725a

Browse files
isilencegregkh
authored andcommitted
io_uring: fix skipping disabling sqo on exec
[ Upstream commit 0b5cd6c ] 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: d9d0521 ("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>
1 parent 54b4c4f commit 186725a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/io_uring.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8917,6 +8917,10 @@ void __io_uring_task_cancel(void)
89178917
/* make sure overflow events are dropped */
89188918
atomic_inc(&tctx->in_idle);
89198919

8920+
/* trigger io_disable_sqo_submit() */
8921+
if (tctx->sqpoll)
8922+
__io_uring_files_cancel(NULL);
8923+
89208924
do {
89218925
/* read completions before cancelations */
89228926
inflight = tctx_inflight(tctx);

0 commit comments

Comments
 (0)