Commit a62682f9 authored by Hao Xu's avatar Hao Xu Committed by Jens Axboe

io_uring: fix missing set of EPOLLONESHOT for CQ ring overflow

We should set EPOLLONESHOT if cqring_fill_event() returns false since
io_poll_add() decides to put req or not by it.

Fixes: 5082620f ("io_uring: terminate multishot poll for CQ ring overflow")
Signed-off-by: default avatarHao Xu <haoxu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20210922101238.7177-3-haoxu@linux.alibaba.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent bd99c71b
...@@ -5337,8 +5337,10 @@ static bool __io_poll_complete(struct io_kiocb *req, __poll_t mask) ...@@ -5337,8 +5337,10 @@ static bool __io_poll_complete(struct io_kiocb *req, __poll_t mask)
} }
if (req->poll.events & EPOLLONESHOT) if (req->poll.events & EPOLLONESHOT)
flags = 0; flags = 0;
if (!io_cqring_fill_event(ctx, req->user_data, error, flags)) if (!io_cqring_fill_event(ctx, req->user_data, error, flags)) {
req->poll.events |= EPOLLONESHOT;
flags = 0; flags = 0;
}
if (flags & IORING_CQE_F_MORE) if (flags & IORING_CQE_F_MORE)
ctx->cq_extra++; ctx->cq_extra++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment