Re: [PATCH 5.19 1/3] io_uring: fail links when poll fails

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

 



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 <asml.silence@xxxxxxxxx>
> ---
>  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




[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