From: Jarek Poplawski Date: Thu, 22 Mar 2007 08:11:26 +0000 (-0800) Subject: [PATCH] lockdep: lockdep_depth vs. debug_locks X-Git-Tag: v2.6.21-rc5~35 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e3a55fd18deab758a2970e0dfcd60a677a920426;p=linux-2.6-omap-h63xx.git [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 Inspired-by: Oleg Nesterov Signed-off-by: Jarek Poplawski Cc: Ingo Molnar Acked-by: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 06fe93a3e91..14c937d345c 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 */