From: Jens Axboe <[email protected]>
To: Pavel Begunkov <[email protected]>, [email protected]
Subject: Re: [PATCH 5.19 1/3] io_uring: fail links when poll fails
Date: Tue, 21 Jun 2022 21:34:08 -0600 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <a78aad962460f9fdfe4aa4c0b62425c88f9415bc.1655852245.git.asml.silence@gmail.com>
On 6/21/22 5:00 PM, Pavel Begunkov wrote:
> Don't forget to cancel all linked requests of poll request when
> __io_arm_poll_handler() failed.
>
> Fixes: aa43477b04025 ("io_uring: poll rework")
> Signed-off-by: Pavel Begunkov <[email protected]>
> ---
> fs/io_uring.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index dffa85d4dc7a..d5ea3c6167b5 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -7405,6 +7405,8 @@ static int io_poll_add(struct io_kiocb *req, unsigned int issue_flags)
> ipt.pt._qproc = io_poll_queue_proc;
>
> ret = __io_arm_poll_handler(req, &req->poll, &ipt, poll->events);
> + if (!ret && ipt.error)
> + req_set_fail(req);
> ret = ret ?: ipt.error;
> if (ret)
> __io_req_complete(req, issue_flags, ret, 0);
We could make this:
if (!ret && ipt.error) {
req_set_fail(req);
ret = ipt.error;
}
and kill that ternary, but we could also then go a bit further with the
completion. So let's just leave that for 5.20.
--
Jens Axboe
next prev parent reply other threads:[~2022-06-22 3:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-21 23:00 [PATCH 5.19 0/3] poll fixes Pavel Begunkov
2022-06-21 23:00 ` [PATCH 5.19 1/3] io_uring: fail links when poll fails Pavel Begunkov
2022-06-22 3:34 ` Jens Axboe [this message]
2022-06-21 23:00 ` [PATCH 5.19 2/3] io_uring: fix wrong arm_poll error handling Pavel Begunkov
2022-06-21 23:00 ` [PATCH 5.19 3/3] io_uring: fix double poll leak on repolling Pavel Begunkov
2022-06-22 3:34 ` Jens Axboe
2022-06-22 3:36 ` [PATCH 5.19 0/3] poll fixes Jens Axboe
2022-06-22 14:59 ` 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 \
[email protected] \
[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