public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Steven Rostedt <srostedt@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	dvhart@linux.intel.com, peterz@infradead.org, richard@nod.at,
	rostedt@goodmis.org, srostedt@redhat.com, tglx@linutronix.de,
	laijs@cn.fujitsu.com, mingo@elte.hu
Subject: [tip:core/urgent] futex: Fix WARN_ON() test for UP
Date: Fri, 25 Mar 2011 10:49:19 GMT	[thread overview]
Message-ID: <tip-29096202176ceaa5016a17ea2dd1aea19a4e90e2@git.kernel.org> (raw)
In-Reply-To: <20110317192208.682654502@goodmis.org>

Commit-ID:  29096202176ceaa5016a17ea2dd1aea19a4e90e2
Gitweb:     http://git.kernel.org/tip/29096202176ceaa5016a17ea2dd1aea19a4e90e2
Author:     Steven Rostedt <srostedt@redhat.com>
AuthorDate: Thu, 17 Mar 2011 15:21:07 -0400
Committer:  Ingo Molnar <mingo@elte.hu>
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@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>
---
 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);

  parent reply	other threads:[~2011-03-25 10:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-17 19:21 [PATCH 0/2] [GIT PULL] futex: Fix WARN_ON triggering on UP Steven Rostedt
2011-03-17 19:21 ` [PATCH 1/2] WARN_ON_SMP(): Allow use in if statements " Steven Rostedt
2011-03-17 20:46   ` Darren Hart
2011-03-25  9:35   ` Peter Zijlstra
2011-03-25 10:48   ` [tip:core/urgent] WARN_ON_SMP(): Allow use in if() " tip-bot for Steven Rostedt
2011-03-25 16:45     ` Linus Torvalds
2011-03-25 18:16       ` Steven Rostedt
2011-03-25 18:19         ` Steven Rostedt
2011-03-25 19:31           ` Alexey Dobriyan
2011-03-25 19:36             ` Steven Rostedt
2011-03-25 19:40             ` Steven Rostedt
2011-03-25 19:47               ` Alexey Dobriyan
2011-03-25 19:53                 ` Steven Rostedt
2011-03-25 19:56                 ` Ingo Molnar
2011-03-17 19:21 ` [PATCH 2/2] futex: Fix WARN_ON() test for UP Steven Rostedt
2011-03-17 20:00   ` Darren Hart
2011-03-25  9:35   ` Peter Zijlstra
2011-03-25 10:49   ` tip-bot for Steven Rostedt [this message]
2011-03-17 19:27 ` [PATCH 0/2] [GIT PULL] futex: Fix WARN_ON triggering on UP Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-29096202176ceaa5016a17ea2dd1aea19a4e90e2@git.kernel.org \
    --to=srostedt@redhat.com \
    --cc=dvhart@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=richard@nod.at \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox