Skip to content

Commit b98186a

Browse files
isilenceaxboe
authored andcommitted
io_uring: update res mask in io_poll_check_events
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(). Cc: [email protected] Fixes: aa43477 ("io_uring: poll rework") Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/2dac97e8f691231049cb259c4ae57e79e40b537c.1668710222.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 5576035 commit b98186a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

io_uring/poll.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ static int io_poll_check_events(struct io_kiocb *req, bool *locked)
258258
return ret;
259259
}
260260

261+
/* force the next iteration to vfs_poll() */
262+
req->cqe.res = 0;
263+
261264
/*
262265
* Release all references, retry if someone tried to restart
263266
* task_work while we were executing it.

0 commit comments

Comments
 (0)