io_uring/poll: always set 'ctx' in io_cancel_data
authorJens Axboe <axboe@kernel.dk>
Fri, 23 Jun 2023 15:54:56 +0000 (09:54 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 17 Jul 2023 16:05:48 +0000 (10:05 -0600)
This isn't strictly necessary for this callsite, as it uses it's
internal lookup for this cancelation purpose. But let's be consistent
with how it's used in general and set ctx as well.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/poll.c

index d4597efe14a7d7f521e387591476d81f18fe522c..c7bb292c9046ed37ddc3a4c2310167ad4970ae50 100644 (file)
@@ -972,8 +972,8 @@ int io_poll_add(struct io_kiocb *req, unsigned int issue_flags)
 int io_poll_remove(struct io_kiocb *req, unsigned int issue_flags)
 {
        struct io_poll_update *poll_update = io_kiocb_to_cmd(req, struct io_poll_update);
-       struct io_cancel_data cd = { .data = poll_update->old_user_data, };
        struct io_ring_ctx *ctx = req->ctx;
+       struct io_cancel_data cd = { .ctx = ctx, .data = poll_update->old_user_data, };
        struct io_hash_bucket *bucket;
        struct io_kiocb *preq;
        int ret2, ret = 0;