diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2022-11-17 19:40:14 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-11-17 20:33:33 +0100 |
commit | b98186aee22fa593bc8c6b2c5d839c2ee518bc8c (patch) | |
tree | 4f37a230e1db46909e62e14b0074e6c965fbb76a /io_uring/poll.c | |
parent | io_uring/poll: lockdep annote io_poll_req_insert_locked (diff) | |
download | linux-b98186aee22fa593bc8c6b2c5d839c2ee518bc8c.tar.xz linux-b98186aee22fa593bc8c6b2c5d839c2ee518bc8c.zip |
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: stable@vger.kernel.org
Fixes: aa43477b04025 ("io_uring: poll rework")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/2dac97e8f691231049cb259c4ae57e79e40b537c.1668710222.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/poll.c')
-rw-r--r-- | io_uring/poll.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/io_uring/poll.c b/io_uring/poll.c index f500506984ec..90920abf91ff 100644 --- a/io_uring/poll.c +++ b/io_uring/poll.c @@ -258,6 +258,9 @@ static int io_poll_check_events(struct io_kiocb *req, bool *locked) return ret; } + /* force the next iteration to vfs_poll() */ + req->cqe.res = 0; + /* * Release all references, retry if someone tried to restart * task_work while we were executing it. |