Re: [PATCH for-6.1 1/4] io_uring: update res mask in io_poll_check_events

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

 



Pavel Begunkov <asml.silence@xxxxxxxxx> writes:

> When io_poll_check_events() collides with someone attempting to queue a
> task work, it'll spin for one more time. However, it'll continue to use
> the mask from the first iteration instead of updating it. For example,
> if the first wake up was a EPOLLIN and the second EPOLLOUT, the
> userspace will not get EPOLLOUT in time.
>
> Clear the mask for all subsequent iterations to force vfs_poll().

Do we have a reproducer for it in liburing?  Either way, I checked the
code, it looks good to me.

Reviewed-by: Gabriel Krisman Bertazi <krisman@xxxxxxx>

>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: aa43477b04025 ("io_uring: poll rework")
> Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
> ---
>  io_uring/poll.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/io_uring/poll.c b/io_uring/poll.c
> index f500506984ec..90920abf91ff 100644
> --- a/io_uring/poll.c
> +++ b/io_uring/poll.c
> @@ -258,6 +258,9 @@ static int io_poll_check_events(struct io_kiocb *req, bool *locked)
>  				return ret;
>  		}
>  
> +		/* force the next iteration to vfs_poll() */
> +		req->cqe.res = 0;
> +
>  		/*
>  		 * Release all references, retry if someone tried to restart
>  		 * task_work while we were executing it.

-- 
Gabriel Krisman Bertazi



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux