diff options
author | Jens Axboe <axboe@kernel.dk> | 2023-06-23 17:34:08 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-07-17 18:05:48 +0200 |
commit | faa9c0ee3cab9c68b79183c9e0111ba967d9f402 (patch) | |
tree | 3104045b604b73d3bf8d6b84b0e985b14c58441e /io_uring | |
parent | io_uring/poll: always set 'ctx' in io_cancel_data (diff) | |
download | linux-faa9c0ee3cab9c68b79183c9e0111ba967d9f402.tar.xz linux-faa9c0ee3cab9c68b79183c9e0111ba967d9f402.zip |
io_uring/timeout: always set 'ctx' in io_cancel_data
In preparation for using a generic handler to match requests for
cancelation purposes, ensure that ctx is set in io_cancel_data. The
timeout handlers don't check for this as it'll always match, but we'll
need it set going forward.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r-- | io_uring/timeout.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/io_uring/timeout.c b/io_uring/timeout.c index fb0547b35dcd..4200099ad96e 100644 --- a/io_uring/timeout.c +++ b/io_uring/timeout.c @@ -409,7 +409,7 @@ static int io_timeout_update(struct io_ring_ctx *ctx, __u64 user_data, struct timespec64 *ts, enum hrtimer_mode mode) __must_hold(&ctx->timeout_lock) { - struct io_cancel_data cd = { .data = user_data, }; + struct io_cancel_data cd = { .ctx = ctx, .data = user_data, }; struct io_kiocb *req = io_timeout_extract(ctx, &cd); struct io_timeout *timeout = io_kiocb_to_cmd(req, struct io_timeout); struct io_timeout_data *data; @@ -473,7 +473,7 @@ int io_timeout_remove(struct io_kiocb *req, unsigned int issue_flags) int ret; if (!(tr->flags & IORING_TIMEOUT_UPDATE)) { - struct io_cancel_data cd = { .data = tr->addr, }; + struct io_cancel_data cd = { .ctx = ctx, .data = tr->addr, }; spin_lock(&ctx->completion_lock); ret = io_timeout_cancel(ctx, &cd); |