Skip to content

Commit 3f8d93d

Browse files
covanamKAGA-KOKO
authored andcommitted
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
1 parent eee00df commit 3f8d93d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2421,7 +2421,7 @@ static enum hrtimer_restart io_cqring_min_timer_wakeup(struct hrtimer *timer)
24212421
goto out_wake;
24222422
}
24232423

2424-
iowq->t.function = io_cqring_timer_wakeup;
2424+
hrtimer_update_function(&iowq->t, io_cqring_timer_wakeup);
24252425
hrtimer_set_expires(timer, iowq->timeout);
24262426
return HRTIMER_RESTART;
24272427
out_wake:

0 commit comments

Comments
 (0)