public inbox for [email protected]
 help / color / mirror / Atom feed
From: Stefano Garzarella <[email protected]>
To: Jens Axboe <[email protected]>
Cc: io-uring <[email protected]>
Subject: Re: [PATCH] io_uring: fail poll arm on queue proc failure
Date: Wed, 12 Aug 2020 10:39:37 +0200	[thread overview]
Message-ID: <20200812083937.m5zmmnnavfdlqlrv@steredhat> (raw)
In-Reply-To: <[email protected]>

On Tue, Aug 11, 2020 at 09:52:55AM -0600, Jens Axboe wrote:
> Check the ipt.error value, it must have been either cleared to zero or
> set to another error than the default -EINVAL if we don't go through the
> waitqueue proc addition. Just give up on poll at that point and return
> failure, this will fallback to async work.
> 
> io_poll_add() doesn't suffer from this failure case, as it returns the
> error value directly.
> 
> Cc: [email protected] # v5.7+
> Reported-by: [email protected]
> Signed-off-by: Jens Axboe <[email protected]>

LGTM:
Reviewed-by: Stefano Garzarella <[email protected]>

Stefano

> 
> ---
> 
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 99582cf5106b..8a2afd8c33c9 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -4883,7 +4883,7 @@ static bool io_arm_poll_handler(struct io_kiocb *req)
>  
>  	ret = __io_arm_poll_handler(req, &apoll->poll, &ipt, mask,
>  					io_async_wake);
> -	if (ret) {
> +	if (ret || ipt.error) {
>  		io_poll_remove_double(req, apoll->double_poll);
>  		spin_unlock_irq(&ctx->completion_lock);
>  		kfree(apoll->double_poll);
> -- 
> Jens Axboe
> 


  reply	other threads:[~2020-08-12  8:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 15:52 [PATCH] io_uring: fail poll arm on queue proc failure Jens Axboe
2020-08-12  8:39 ` Stefano Garzarella [this message]
2020-08-12 14:30   ` 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=20200812083937.m5zmmnnavfdlqlrv@steredhat \
    [email protected] \
    [email protected] \
    [email protected] \
    /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