Linux io-uring development
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH] io_uring: fix invalid handler for double apoll
Date: Sun, 25 Oct 2020 16:24:32 +0000	[thread overview]
Message-ID: <2022677d-6783-468d-6e77-43208a91edba@gmail.com> (raw)
In-Reply-To: <1ea94ec7-d80a-527b-5366-b91815496f4a@kernel.dk>

On 25/10/2020 15:53, Jens Axboe wrote:
> On 10/25/20 8:26 AM, Pavel Begunkov wrote:
>> io_poll_double_wake() is called for both: poll requests and as apoll
>> (internal poll to make rw and other requests), hence when it calls
>> __io_async_wake() it should use a right callback depending on the
>> current poll type.
> 
> Can we do something like this instead? Untested...

It should work, but looks less comprehensible. Though, it'll need
some refactoring in the future either way.

> 
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index b42dfa0243bf..a0147c0e5320 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -4978,7 +4978,7 @@ static int io_poll_double_wake(struct wait_queue_entry *wait, unsigned mode,
>  		wait->private = NULL;
>  		spin_unlock(&poll->head->lock);
>  		if (!done)
> -			__io_async_wake(req, poll, mask, io_poll_task_func);
> +			poll->wait.func(wait, mode, sync, key);
>  	}
>  	refcount_dec(&req->refs);
>  	return 1;
> 

-- 
Pavel Begunkov

  reply	other threads:[~2020-10-25 16:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-25 14:26 [PATCH] io_uring: fix invalid handler for double apoll Pavel Begunkov
2020-10-25 15:53 ` Jens Axboe
2020-10-25 16:24   ` Pavel Begunkov [this message]
2020-10-25 18:42     ` Jens Axboe
2020-10-25 19:01       ` Pavel Begunkov
2020-10-25 19:18         ` Jens Axboe
2020-10-25 19:32           ` Pavel Begunkov
2020-10-25 19:44             ` Jens Axboe
2020-10-25 19:54               ` Pavel Begunkov
2020-10-26  1:22                 ` 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=2022677d-6783-468d-6e77-43208a91edba@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=stable@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