diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2006-02-01 06:05:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-01 11:53:12 -0500 |
commit | a16a1c095a2392d49fafea22f3a508e268ef7167 (patch) | |
tree | ee5da8c9f04fe03eac9ab399b00f089748a74ddd | |
parent | b6557fbca805217588a412f391a65ceafcf1a1af (diff) |
[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>
-rw-r--r-- | kernel/itimer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/itimer.c b/kernel/itimer.c index 6433d0685506..379be2f8c84c 100644 --- a/kernel/itimer.c +++ b/kernel/itimer.c | |||
@@ -155,16 +155,16 @@ int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue) | |||
155 | again: | 155 | again: |
156 | spin_lock_irq(&tsk->sighand->siglock); | 156 | spin_lock_irq(&tsk->sighand->siglock); |
157 | timer = &tsk->signal->real_timer; | 157 | timer = &tsk->signal->real_timer; |
158 | /* We are sharing ->siglock with it_real_fn() */ | ||
159 | if (hrtimer_try_to_cancel(timer) < 0) { | ||
160 | spin_unlock_irq(&tsk->sighand->siglock); | ||
161 | goto again; | ||
162 | } | ||
163 | if (ovalue) { | 158 | if (ovalue) { |
164 | ovalue->it_value = itimer_get_remtime(timer); | 159 | ovalue->it_value = itimer_get_remtime(timer); |
165 | ovalue->it_interval | 160 | ovalue->it_interval |
166 | = ktime_to_timeval(tsk->signal->it_real_incr); | 161 | = ktime_to_timeval(tsk->signal->it_real_incr); |
167 | } | 162 | } |
163 | /* We are sharing ->siglock with it_real_fn() */ | ||
164 | if (hrtimer_try_to_cancel(timer) < 0) { | ||
165 | spin_unlock_irq(&tsk->sighand->siglock); | ||
166 | goto again; | ||
167 | } | ||
168 | tsk->signal->it_real_incr = | 168 | tsk->signal->it_real_incr = |
169 | timeval_to_ktime(value->it_interval); | 169 | timeval_to_ktime(value->it_interval); |
170 | expires = timeval_to_ktime(value->it_value); | 170 | expires = timeval_to_ktime(value->it_value); |