Commit:     c0d1d2bf5a28f78def7b68ca1eb5ba31aafd43a1
Parent:     51b94d2a5a90d4800e74d7348bcde098a28f4fb3
Author:     Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 8 13:46:57 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Jun 8 17:23:34 2007 -0700

    rt-mutex: fix stale return value
    Alexey Kuznetsov found some problems in the pi-futex code.
    The major problem is a stale return value in rt_mutex_slowlock():
    When the pi chain walk returns -EDEADLK, but the waiter was woken up during
    the phases where the locks were dropped, the rtmutex could be acquired, but
    due to the stale return value -EDEADLK returned to the caller.
    Reset the return value in the retry path.
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
    Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
    Cc: Steven Rostedt <[EMAIL PROTECTED]>
    Cc: Alexey Kuznetsov <[EMAIL PROTECTED]>
    Cc: Ulrich Drepper <[EMAIL PROTECTED]>
    Cc: Eric Dumazet <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 kernel/rtmutex.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c
index 12879f6..a273183 100644
--- a/kernel/rtmutex.c
+++ b/kernel/rtmutex.c
@@ -636,9 +636,16 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
                         * all over without going into schedule to try
                         * to get the lock now:
-                       if (unlikely(!waiter.task))
+                       if (unlikely(!waiter.task)) {
+                               /*
+                                * Reset the return value. We might
+                                * have returned with -EDEADLK and the
+                                * owner released the lock while we
+                                * were walking the pi chain.
+                                */
+                               ret = 0;
+                       }
                        if (unlikely(ret))
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to