Commit c83c8462 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe
Browse files

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: ea97f6c8 ("io_uring: add support for multishot timeouts")
Reported-by: default avatarChristian Mazakas <christian.mazakas@gmail.com>
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/e6516c3304eb654ec234cfa65c88a9579861e597.1736015288.git.asml.silence@gmail.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent ed123c94
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -427,10 +427,12 @@ static int io_timeout_update(struct io_ring_ctx *ctx, __u64 user_data,

	timeout->off = 0; /* noseq */
	data = req->async_data;
	data->ts = *ts;

	list_add_tail(&timeout->list, &ctx->timeout_list);
	hrtimer_init(&data->timer, io_timeout_get_clock(data), mode);
	data->timer.function = io_timeout_fn;
	hrtimer_start(&data->timer, timespec64_to_ktime(*ts), mode);
	hrtimer_start(&data->timer, timespec64_to_ktime(data->ts), mode);
	return 0;
}