Re: [PATCH 5/5] io_uring: implement multishot mode for accept

Jens Axboe
2022-05-06T20:50:55Z

On 5/6/22 1:01 AM, Hao Xu wrote:
> @@ -5748,8 +5758,12 @@ static int io_accept(struct io_kiocb *req, unsigned int issue_flags)
> if (!fixed)
> put_unused_fd(fd);
> ret = PTR_ERR(file);
> - if (ret == -EAGAIN && force_nonblock)
> - return -EAGAIN;
> + if (ret == -EAGAIN && force_nonblock) {
> + if ((req->flags & REQ_F_APOLL_MULTI_POLLED) ==
> + REQ_F_APOLL_MULTI_POLLED)
> + ret = 0;
> + return ret;

FWIW, this

if ((req->flags & REQ_F_APOLL_MULTI_POLLED) == REQ_F_APOLL_MULTI_POLLED)

is identical to

if (req->flags & REQ_F_APOLL_MULTI_POLLED)

but I suspect this used to check more flags (??), because as it stands
it seems a bit nonsensical.

--
Jens Axboe