Skip to content

Commit c8b5e26

Browse files
committed
io_uring: use type appropriate io_kiocb handler for double poll
io_poll_double_wake() is called for both request types - both pure poll requests, and internal polls. This means that we should be using the right handler based on the request type. Use the one that the original caller already assigned for the waitqueue handling, that will always match the correct type. Cc: stable@vger.kernel.org # v5.8+ Reported-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 0d63c14 commit c8b5e26

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

fs/io_uring.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4959,8 +4959,10 @@ static int io_poll_double_wake(struct wait_queue_entry *wait, unsigned mode,
49594959
/* make sure double remove sees this as being gone */
49604960
wait->private = NULL;
49614961
spin_unlock(&poll->head->lock);
4962-
if (!done)
4963-
__io_async_wake(req, poll, mask, io_poll_task_func);
4962+
if (!done) {
4963+
/* use wait func handler, so it matches the rq type */
4964+
poll->wait.func(&poll->wait, mode, sync, key);
4965+
}
49644966
}
49654967
refcount_dec(&req->refs);
49664968
return 1;

0 commit comments

Comments
 (0)