diff options
author | Nam Cao <namcao@linutronix.de> | 2025-02-05 13:55:14 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2025-02-18 19:41:35 +0300 |
commit | 3f8d93d1371f460ed30ebfa30fb930c0605035fc (patch) | |
tree | b25900bfb9a622a22c32c3bfca69fa96ae507189 | |
parent | eee00df8e1f1f5648ed8f9e40e2bb54c2877344a (diff) | |
download | linux-3f8d93d1371f460ed30ebfa30fb930c0605035fc.tar.xz |
io_uring: Use helper function hrtimer_update_function()
The field 'function' of struct hrtimer should not be changed directly, as
the write is lockless and a concurrent timer expiry might end up using the
wrong function pointer.
Switch to use hrtimer_update_function() which also performs runtime checks
that it is safe to modify the callback.
Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/9b33f490fb1d207d3918ef5e116dc3412ae35c1e.1738746927.git.namcao@linutronix.de
-rw-r--r-- | io_uring/io_uring.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index ceacf6230e34..936f8b4106cf 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2421,7 +2421,7 @@ static enum hrtimer_restart io_cqring_min_timer_wakeup(struct hrtimer *timer) goto out_wake; } - iowq->t.function = io_cqring_timer_wakeup; + hrtimer_update_function(&iowq->t, io_cqring_timer_wakeup); hrtimer_set_expires(timer, iowq->timeout); return HRTIMER_RESTART; out_wake: |