From: Jens Axboe Date: Sun, 25 Oct 2020 19:53:26 +0000 (-0600) Subject: io_uring: use type appropriate io_kiocb handler for double poll X-Git-Tag: v5.9.5~96 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e3902c9ac8bb93d18eaa8d6bb9c3475305609d96;p=users%2Fdwmw2%2Flinux.git io_uring: use type appropriate io_kiocb handler for double poll commit c8b5e2600a2cfa1cdfbecf151afd67aee227381d upstream. 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 Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/io_uring.c b/fs/io_uring.c index 50a7a99dad4ca..64f214a3dc9dd 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4786,8 +4786,10 @@ static int io_poll_double_wake(struct wait_queue_entry *wait, unsigned mode, /* make sure double remove sees this as being gone */ wait->private = NULL; spin_unlock(&poll->head->lock); - if (!done) - __io_async_wake(req, poll, mask, io_poll_task_func); + if (!done) { + /* use wait func handler, so it matches the rq type */ + poll->wait.func(&poll->wait, mode, sync, key); + } } refcount_dec(&req->refs); return 1;