[tip:core/urgent] futex: Fix WARN_ON() test for UP
From: tip-bot for Steven Rostedt
Date: Fri Mar 25 2011 - 06:50:19 EST
Commit-ID: 29096202176ceaa5016a17ea2dd1aea19a4e90e2
Gitweb: http://git.kernel.org/tip/29096202176ceaa5016a17ea2dd1aea19a4e90e2
Author: Steven Rostedt <srostedt@xxxxxxxxxx>
AuthorDate: Thu, 17 Mar 2011 15:21:07 -0400
Committer: Ingo Molnar <mingo@xxxxxxx>
CommitDate: Fri, 25 Mar 2011 11:32:11 +0100
futex: Fix WARN_ON() test for UP
An update of the futex code had a
WARN_ON(!spin_is_locked(q->lock_ptr))
But on UP, spin_is_locked() is always false, and will
trigger this warning, and even worse, it will exit the function
without doing the necessary work.
Converting this to a WARN_ON_SMP() fixes the problem.
Reported-by: Richard Weinberger <richard@xxxxxx>
Tested-by: Richard Weinberger <richard@xxxxxx>
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
Acked-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Acked-by: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Acked-by: Darren Hart <dvhart@xxxxxxxxxxxxxxx>
Cc: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
LKML-Reference: <20110317192208.682654502@xxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
kernel/futex.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/futex.c b/kernel/futex.c
index bda4157..823aae3 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -782,8 +782,8 @@ static void __unqueue_futex(struct futex_q *q)
{
struct futex_hash_bucket *hb;
- if (WARN_ON(!q->lock_ptr || !spin_is_locked(q->lock_ptr)
- || plist_node_empty(&q->list)))
+ if (WARN_ON_SMP(!q->lock_ptr || !spin_is_locked(q->lock_ptr))
+ || WARN_ON(plist_node_empty(&q->list)))
return;
hb = container_of(q->lock_ptr, struct futex_hash_bucket, lock);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/