Skip to content

Commit a62682f

Browse files
Hao Xuaxboe
authored andcommitted
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: 5082620 ("io_uring: terminate multishot poll for CQ ring overflow") Signed-off-by: Hao Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent bd99c71 commit a62682f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/io_uring.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5337,8 +5337,10 @@ static bool __io_poll_complete(struct io_kiocb *req, __poll_t mask)
53375337
}
53385338
if (req->poll.events & EPOLLONESHOT)
53395339
flags = 0;
5340-
if (!io_cqring_fill_event(ctx, req->user_data, error, flags))
5340+
if (!io_cqring_fill_event(ctx, req->user_data, error, flags)) {
5341+
req->poll.events |= EPOLLONESHOT;
53415342
flags = 0;
5343+
}
53425344
if (flags & IORING_CQE_F_MORE)
53435345
ctx->cq_extra++;
53445346

0 commit comments

Comments
 (0)