[15/45] posix-timers: Clear overrun in common_timer_set()

Message ID 20230606142031.872478114@linutronix.de
State New
Headers
Series posix-timers: Cure inconsistencies and the SIG_IGN mess |

Commit Message

Thomas Gleixner June 6, 2023, 2:37 p.m. UTC
  Keeping the overrun count of the previous setup around is just wrong. The
new setting has nothing to do with the previous one and has to start from a
clean slate.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/posix-timers.c |    1 +
 1 file changed, 1 insertion(+)
  

Comments

Frederic Weisbecker June 30, 2023, 9:40 p.m. UTC | #1
Le Tue, Jun 06, 2023 at 04:37:42PM +0200, Thomas Gleixner a écrit :
> Keeping the overrun count of the previous setup around is just wrong. The
> new setting has nothing to do with the previous one and has to start from a
> clean slate.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
  

Patch

--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -867,6 +867,7 @@  int common_timer_set(struct k_itimer *ti
 	timr->it_requeue_pending = (timr->it_requeue_pending + 2) &
 		~REQUEUE_PENDING;
 	timr->it_overrun_last = 0;
+	timr->it_overrun = -1LL;
 
 	/* Switch off the timer when it_value is zero */
 	if (!new_setting->it_value.tv_sec && !new_setting->it_value.tv_nsec)