[patch] lock debugging: fix DEBUG_LOCKS_WARN_ON() & debug_locks_silent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Matthew Wilcox <[email protected]> wrote:

> Moreover, do we want to get stack dumps while running the locking 
> testsuite in the first place?  From various comments, it looks like 
> it's supposed to be turned off, but it looks like the sense of 
> debug_locks_silent is inverted in the definition of 
> DEBUG_LOCKS_WARN_ON:
> 
>         if (unlikely(c)) {                                              \
>                 if (debug_locks_silent || debug_locks_off())            \
>                         WARN_ON(1);                                     \
> 
> Surely that should be:
> 
> 		if (!debug_locks_silent && debug_locks_off())
> 			WARN_ON(1);

oops, indeed! Fix below.

	Ingo

------------->
Subject: [patch] lock debugging: fix DEBUG_LOCKS_WARN_ON() & debug_locks_silent
From: Ingo Molnar <[email protected]>

Matthew Wilcox noticed that the debug_locks_silent use should be
inverted in DEBUG_LOCKS_WARN_ON(). This bug was causing spurious
stacktraces and incorrect failures in the locking self-test on the
parisc kernel.

Bug-found-by: Matthew Wilcox <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
 include/linux/debug_locks.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/include/linux/debug_locks.h
===================================================================
--- linux.orig/include/linux/debug_locks.h
+++ linux/include/linux/debug_locks.h
@@ -24,7 +24,7 @@ extern int debug_locks_off(void);
 	int __ret = 0;							\
 									\
 	if (unlikely(c)) {						\
-		if (debug_locks_silent || debug_locks_off())		\
+		if (!debug_locks_silent && debug_locks_off())		\
 			WARN_ON(1);					\
 		__ret = 1;						\
 	}								\
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux