<linux/seccomp.h> needs to include <linux/errno.h>.
[safe/jmp/linux-2.6] / kernel / futex.c
index 9c97f67..eef8cd2 100644 (file)
@@ -658,14 +658,9 @@ double_lock_hb(struct futex_hash_bucket *hb1, struct futex_hash_bucket *hb2)
 static inline void
 double_unlock_hb(struct futex_hash_bucket *hb1, struct futex_hash_bucket *hb2)
 {
-       if (hb1 <= hb2) {
-               spin_unlock(&hb2->lock);
-               if (hb1 < hb2)
-                       spin_unlock(&hb1->lock);
-       } else { /* hb1 > hb2 */
-               spin_unlock(&hb1->lock);
+       spin_unlock(&hb1->lock);
+       if (hb1 != hb2)
                spin_unlock(&hb2->lock);
-       }
 }
 
 /*
@@ -888,7 +883,12 @@ retry_private:
 out_unlock:
        double_unlock_hb(hb1, hb2);
 
-       /* drop_futex_key_refs() must be called outside the spinlocks. */
+       /*
+        * drop_futex_key_refs() must be called outside the spinlocks. During
+        * the requeue we moved futex_q's from the hash bucket at key1 to the
+        * one at key2 and updated their key pointer.  We no longer need to
+        * hold the references to key1.
+        */
        while (--drop_count >= 0)
                drop_futex_key_refs(&key1);