diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-03-17 15:21:07 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-03-25 06:32:11 -0400 |
commit | 29096202176ceaa5016a17ea2dd1aea19a4e90e2 (patch) | |
tree | 1350963a65beec5d9677b7e295c5ad9eb718b64e /kernel/futex.c | |
parent | 2092e6be82ec71ecbf5a8ceeef004bbcbdb78812 (diff) |
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@nod.at>
Tested-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
LKML-Reference: <20110317192208.682654502@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index bda415715382..823aae3e2a96 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -782,8 +782,8 @@ static void __unqueue_futex(struct futex_q *q) | |||
782 | { | 782 | { |
783 | struct futex_hash_bucket *hb; | 783 | struct futex_hash_bucket *hb; |
784 | 784 | ||
785 | if (WARN_ON(!q->lock_ptr || !spin_is_locked(q->lock_ptr) | 785 | if (WARN_ON_SMP(!q->lock_ptr || !spin_is_locked(q->lock_ptr)) |
786 | || plist_node_empty(&q->list))) | 786 | || WARN_ON(plist_node_empty(&q->list))) |
787 | return; | 787 | return; |
788 | 788 | ||
789 | hb = container_of(q->lock_ptr, struct futex_hash_bucket, lock); | 789 | hb = container_of(q->lock_ptr, struct futex_hash_bucket, lock); |