summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@o2.pl>2007-03-22 00:11:26 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-22 19:39:06 -0700
commite3a55fd18deab758a2970e0dfcd60a677a920426 (patch)
tree87a0b7e3ae565c10077b1444fda0a462e2e88a1e /include
parent058560fbd70190ea6b50b5df4d814bc30911d06b (diff)
[PATCH] lockdep: lockdep_depth vs. debug_locks
lockdep found a bug during a run of workqueue function - this could be also caused by a bug from other code running simultaneously. lockdep really shouldn't be used when debug_locks == 0! Reported-by: Folkert van Heusden <folkert@vanheusden.com> Inspired-by: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Jarek Poplawski <jarkao2@o2.pl> Cc: Ingo Molnar <mingo@elte.hu> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/lockdep.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 06fe93a3e916..14c937d345cb 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -245,7 +245,7 @@ extern void lock_release(struct lockdep_map *lock, int nested,
# define INIT_LOCKDEP .lockdep_recursion = 0,
-#define lockdep_depth(tsk) ((tsk)->lockdep_depth)
+#define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0)
#else /* !LOCKDEP */