mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[PATCH] hrtimers: fix oldvalue return in setitimer
This resolves bugzilla bug#5617. The oldvalue of the timer was read after the timer was cancelled, so the remaining time was always zero. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
b6557fbca8
commit
a16a1c095a
1 changed files with 5 additions and 5 deletions
|
@ -155,16 +155,16 @@ int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue)
|
||||||
again:
|
again:
|
||||||
spin_lock_irq(&tsk->sighand->siglock);
|
spin_lock_irq(&tsk->sighand->siglock);
|
||||||
timer = &tsk->signal->real_timer;
|
timer = &tsk->signal->real_timer;
|
||||||
/* We are sharing ->siglock with it_real_fn() */
|
|
||||||
if (hrtimer_try_to_cancel(timer) < 0) {
|
|
||||||
spin_unlock_irq(&tsk->sighand->siglock);
|
|
||||||
goto again;
|
|
||||||
}
|
|
||||||
if (ovalue) {
|
if (ovalue) {
|
||||||
ovalue->it_value = itimer_get_remtime(timer);
|
ovalue->it_value = itimer_get_remtime(timer);
|
||||||
ovalue->it_interval
|
ovalue->it_interval
|
||||||
= ktime_to_timeval(tsk->signal->it_real_incr);
|
= ktime_to_timeval(tsk->signal->it_real_incr);
|
||||||
}
|
}
|
||||||
|
/* We are sharing ->siglock with it_real_fn() */
|
||||||
|
if (hrtimer_try_to_cancel(timer) < 0) {
|
||||||
|
spin_unlock_irq(&tsk->sighand->siglock);
|
||||||
|
goto again;
|
||||||
|
}
|
||||||
tsk->signal->it_real_incr =
|
tsk->signal->it_real_incr =
|
||||||
timeval_to_ktime(value->it_interval);
|
timeval_to_ktime(value->it_interval);
|
||||||
expires = timeval_to_ktime(value->it_value);
|
expires = timeval_to_ktime(value->it_value);
|
||||||
|
|
Loading…
Reference in a new issue