diff options
author | Jens Axboe <axboe@kernel.dk> | 2020-10-25 13:53:26 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-10-25 13:53:26 -0600 |
commit | c8b5e2600a2cfa1cdfbecf151afd67aee227381d (patch) | |
tree | 7c9c0042d19ecbfab47c04ac0e095bd202d55838 /fs/io_uring.c | |
parent | 0d63c148d6d9ac57c124b618f66269bb4558553b (diff) | |
download | lwn-c8b5e2600a2cfa1cdfbecf151afd67aee227381d.tar.gz lwn-c8b5e2600a2cfa1cdfbecf151afd67aee227381d.zip |
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>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 74dcc4471e9b..2f6af230e86e 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4959,8 +4959,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; |