Skip to content

Commit c83c846

Browse files
isilenceaxboe
authored andcommitted
io_uring/timeout: fix multishot updates
After update only the first shot of a multishot timeout request adheres to the new timeout value while all subsequent retries continue to use the old value. Don't forget to update the timeout stored in struct io_timeout_data. Cc: stable@vger.kernel.org Fixes: ea97f6c ("io_uring: add support for multishot timeouts") Reported-by: Christian Mazakas <christian.mazakas@gmail.com> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/e6516c3304eb654ec234cfa65c88a9579861e597.1736015288.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent ed123c9 commit c83c846

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

io_uring/timeout.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,12 @@ static int io_timeout_update(struct io_ring_ctx *ctx, __u64 user_data,
427427

428428
timeout->off = 0; /* noseq */
429429
data = req->async_data;
430+
data->ts = *ts;
431+
430432
list_add_tail(&timeout->list, &ctx->timeout_list);
431433
hrtimer_init(&data->timer, io_timeout_get_clock(data), mode);
432434
data->timer.function = io_timeout_fn;
433-
hrtimer_start(&data->timer, timespec64_to_ktime(*ts), mode);
435+
hrtimer_start(&data->timer, timespec64_to_ktime(data->ts), mode);
434436
return 0;
435437
}
436438

0 commit comments

Comments
 (0)