From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hrndva-omtalb.mail.rr.com (hrndva-omtalb.mail.rr.com [71.74.56.122]) by ozlabs.org (Postfix) with ESMTP id 6E59ADDDE1 for ; Sat, 6 Sep 2008 15:09:08 +1000 (EST) Message-Id: <20080906050906.111265558@goodmis.org> References: <20080906050602.409299112@goodmis.org> Date: Sat, 06 Sep 2008 01:06:04 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ftrace: fix unlocking of hash Cc: Andrew Morton , Peter Zijlstra , David Miller , linuxppc-dev@ozlabs.org, Steven Rostedt , Ingo Molnar , Thomas Gleixner List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This must be brown paper bag week for Steven Rostedt! While working on ftrace for PPC, I discovered that the hash locking done when CONFIG_FTRACE_MCOUNT_RECORD is not set, is totally incorrect. With a cut and paste error, I had the hash lock macro to lock for both hash_lock _and_ hash_unlock! This bug did not affect x86 since this bug was introduced when CONFIG_FTRACE_MCOUNT_RECORD was added to x86. Signed-off-by: Steven Rostedt --- kernel/trace/ftrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: linux-tip.git/kernel/trace/ftrace.c =================================================================== --- linux-tip.git.orig/kernel/trace/ftrace.c 2008-09-05 21:53:46.000000000 -0700 +++ linux-tip.git/kernel/trace/ftrace.c 2008-09-05 21:57:57.000000000 -0700 @@ -170,7 +170,8 @@ static int __unregister_ftrace_function( */ static DEFINE_SPINLOCK(ftrace_hash_lock); #define ftrace_hash_lock(flags) spin_lock_irqsave(&ftrace_hash_lock, flags) -#define ftrace_hash_unlock(flags) spin_lock_irqsave(&ftrace_hash_lock, flags) +#define ftrace_hash_unlock(flags) \ + spin_unlock_irqrestore(&ftrace_hash_lock, flags) #else /* This is protected via the ftrace_lock with MCOUNT_RECORD. */ #define ftrace_hash_lock(flags) do { (void)(flags); } while (0) --