diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-07-10 02:45:59 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-07-11 08:43:58 -0600 |
commit | dfa01077529293ef05f0507606b79b0238ac7cdd (patch) | |
tree | 808a165186a19913ad9c1f5ea40d0a356a3ae5a7 | |
parent | 9ce85ef2cb5c738754837a6937e120694cde33c9 (diff) |
io_uring: use right task for exiting checksio_uring-5.14-test
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>
-rw-r--r-- | fs/io_uring.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index d94fb5835a20..118215211bb2 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2016,7 +2016,7 @@ static void io_req_task_submit(struct io_kiocb *req) /* ctx stays valid until unlock, even if we drop all ours ctx->refs */ mutex_lock(&ctx->uring_lock); - if (!(current->flags & PF_EXITING) && !current->in_execve) + if (!(req->task->flags & PF_EXITING) && !req->task->in_execve) __io_queue_sqe(req); else io_req_complete_failed(req, -EFAULT); |