Re: [PATCH] io_uring: fix invalid handler for double apoll

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux