io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Pavel Begunkov <asml.silence@gmail.com>
Cc: io-uring <io-uring@vger.kernel.org>,
	"Pavel Begunkov (Silence)" <asml.silence@gmail.com>
Subject: Re: [PATCH 5.14] io_uring: use right task for exiting checks
Date: Sat, 10 Jul 2021 07:40:19 -0600	[thread overview]
Message-ID: <7b465849-f046-530f-42a2-8e42d54bdca7@kernel.dk> (raw)
In-Reply-To: <cb413c715bed0bc9c98b169059ea9c8a2c770715.1625881431.git.asml.silence@gmail.com>

On Fri, Jul 9, 2021 at 7:46 PM Pavel Begunkov <asml.silence@gmail.com> wrote:
>
> 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>
> ---
>  fs/io_uring.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 7167c61c6d1b..770fdcd7d3e4 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);

I don't think that ->in_execve check is useful anymore now that we don't
have weak references to the files table, so it should probably just go
away.

-- 
Jens Axboe


  reply	other threads:[~2021-07-10 13:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-10  1:45 [PATCH 5.14] io_uring: use right task for exiting checks Pavel Begunkov
2021-07-10 13:40 ` Jens Axboe [this message]
2021-07-10 14:07   ` Pavel Begunkov
2021-07-10 15:36     ` 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=7b465849-f046-530f-42a2-8e42d54bdca7@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --cc=io-uring@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;
as well as URLs for NNTP newsgroup(s).