]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
hrtimer: fix hrtimer_init_sleeper() users
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 1 Feb 2008 16:45:13 +0000 (17:45 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 1 Feb 2008 16:45:13 +0000 (17:45 +0100)
this patch:

 commit 37bb6cb4097e29ffee970065b74499cbf10603a3
 Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
 Date:   Fri Jan 25 21:08:32 2008 +0100

     hrtimer: unlock hrtimer_wakeup

Broke hrtimer_init_sleeper() users. It forgot to fix up the futex
caller of this function to detect the failed queueing and messed up
the do_nanosleep() caller in that it could leak a TASK_INTERRUPTIBLE
state.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/futex.c
kernel/hrtimer.c

index db9824de8bf061323b734d88377a6fa606fb9a86..0edd314798c02dd566c3a46254565daa35cba6b0 100644 (file)
@@ -1252,6 +1252,8 @@ static int futex_wait(u32 __user *uaddr, struct rw_semaphore *fshared,
                        t.timer.expires = *abs_time;
 
                        hrtimer_start(&t.timer, t.timer.expires, HRTIMER_MODE_ABS);
+                       if (!hrtimer_active(&t.timer))
+                               t.task = NULL;
 
                        /*
                         * the timer could have already expired, in which
index bd5d6b5060bcd5704c278ea38954862fb463889f..1069998fe25fdcce1af97f7be831852d85b6d20b 100644 (file)
@@ -1315,6 +1315,8 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod
 
        } while (t->task && !signal_pending(current));
 
+       __set_current_state(TASK_RUNNING);
+
        return t->task == NULL;
 }