public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Hao Xu <haoxu@linux.alibaba.com>, Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org, Joseph Qi <joseph.qi@linux.alibaba.com>
Subject: Re: [PATCH] io_uring: fix wrong condition to grab uring lock
Date: Thu, 14 Oct 2021 15:13:48 +0100	[thread overview]
Message-ID: <a8a702e8-568b-ffc4-bf6d-8e868697e825@gmail.com> (raw)
In-Reply-To: <20211014140400.50235-1-haoxu@linux.alibaba.com>

On 10/14/21 15:04, Hao Xu wrote:
> Grab uring lock when we are in io-worker rather than in the original
> or system-wq context since we already hold it in these two situation.

Good catch, lgtm


> Signed-off-by: Hao Xu <haoxu@linux.alibaba.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 73135c5c6168..e2ed21c65f71 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -2890,7 +2890,7 @@ static void kiocb_done(struct kiocb *kiocb, ssize_t ret,
>   			struct io_ring_ctx *ctx = req->ctx;
>   
>   			req_set_fail(req);
> -			if (issue_flags & IO_URING_F_NONBLOCK) {
> +			if (!(issue_flags & IO_URING_F_NONBLOCK)) {
>   				mutex_lock(&ctx->uring_lock);
>   				__io_req_complete(req, issue_flags, ret, cflags);
>   				mutex_unlock(&ctx->uring_lock);
> 

-- 
Pavel Begunkov

  parent reply	other threads:[~2021-10-14 14:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 14:04 [PATCH] io_uring: fix wrong condition to grab uring lock Hao Xu
2021-10-14 14:09 ` Hao Xu
2021-10-14 14:13 ` Pavel Begunkov [this message]
2021-10-14 15:06 ` 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=a8a702e8-568b-ffc4-bf6d-8e868697e825@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=haoxu@linux.alibaba.com \
    --cc=io-uring@vger.kernel.org \
    --cc=joseph.qi@linux.alibaba.com \
    /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