From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: [email protected], Christian Mazakas <[email protected]>
Subject: [PATCH 1/1] io_uring/timeout: fix multishot updates
Date: Sat, 4 Jan 2025 18:29:02 +0000 [thread overview]
Message-ID: <e6516c3304eb654ec234cfa65c88a9579861e597.1736015288.git.asml.silence@gmail.com> (raw)
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: [email protected]
Fixes: ea97f6c8558e8 ("io_uring: add support for multishot timeouts")
Reported-by: Christian Mazakas <[email protected]>
Signed-off-by: Pavel Begunkov <[email protected]>
---
io_uring/timeout.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/io_uring/timeout.c b/io_uring/timeout.c
index f55e25338b23..dd719e3ca870 100644
--- a/io_uring/timeout.c
+++ b/io_uring/timeout.c
@@ -410,10 +410,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;
}
--
2.47.1
next reply other threads:[~2025-01-04 18:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-04 18:29 Pavel Begunkov [this message]
2025-01-04 18:39 ` [PATCH 1/1] io_uring/timeout: fix multishot updates Jens Axboe
2025-01-04 20:44 ` Pavel Begunkov
2025-01-04 22:12 ` Jens Axboe
2025-01-04 18:40 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e6516c3304eb654ec234cfa65c88a9579861e597.1736015288.git.asml.silence@gmail.com \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox