Skip to content

Commit 9c68826

Browse files
isilenceaxboe
authored andcommitted
io_uring: use right task for exiting checks
When we use delayed_work for fallback execution of requests, current will be not of the submitter task, and so checks in io_req_task_submit() may not behave as expected. Currently, it leaves inline completions not flushed, so making io_ring_exit_work() to hang. Use the submitter task for all those checks. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/cb413c715bed0bc9c98b169059ea9c8a2c770715.1625881431.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent e73f0f0 commit 9c68826

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,7 @@ static void io_req_task_submit(struct io_kiocb *req)
20162016

20172017
/* ctx stays valid until unlock, even if we drop all ours ctx->refs */
20182018
mutex_lock(&ctx->uring_lock);
2019-
if (!(current->flags & PF_EXITING) && !current->in_execve)
2019+
if (!(req->task->flags & PF_EXITING) && !req->task->in_execve)
20202020
__io_queue_sqe(req);
20212021
else
20222022
io_req_complete_failed(req, -EFAULT);

0 commit comments

Comments
 (0)