diff options
| author | Pavel Begunkov <asml.silence@gmail.com> | 2025-01-04 18:29:02 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-01-17 13:40:51 +0100 |
| commit | 2b30bffd9a77a346343906b5f79f54bdee229eb8 (patch) | |
| tree | 5f1dc9440f6bec207d57d14358e599ade4fe1429 /io_uring | |
| parent | 5c331df9a5ef0c272cd096946205ee60a3f6a522 (diff) | |
| download | linux-2b30bffd9a77a346343906b5f79f54bdee229eb8.tar.gz linux-2b30bffd9a77a346343906b5f79f54bdee229eb8.tar.bz2 linux-2b30bffd9a77a346343906b5f79f54bdee229eb8.zip | |
io_uring/timeout: fix multishot updates
commit c83c846231db8b153bfcb44d552d373c34f78245 upstream.
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: ea97f6c8558e8 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring')
| -rw-r--r-- | io_uring/timeout.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/io_uring/timeout.c b/io_uring/timeout.c index 9973876d91b0..21c4bfea79f1 100644 --- a/io_uring/timeout.c +++ b/io_uring/timeout.c @@ -409,10 +409,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; } |
