projects/linux·commit 60e114d1

[PATCH] lockdep: debug_locks check after check_chain_key

60e114d1 · Jarek Poplawski <[email protected]> · 2007-02-20 13:58:00 -08:00

In __lock_acquire check_chain_key can turn off debug_locks, so check is
needed to assure proper return code.

Signed-off-by: Jarek Poplawski <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
60e114d1134555d1813e20a8cd86304331da05c7
Parents
34173a4a

Changes

1 files changed · +4 −0

FileStatusAddDelContent
kernel/lockdep.cmodified+4−0View file

kernel/lockdep.c

View file
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 592c576..a08a172 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -2228,6 +2228,10 @@ out_calc_hash:
curr->lockdep_depth++;
check_chain_key(curr);
+#ifdef CONFIG_DEBUG_LOCKDEP
+ if (unlikely(!debug_locks))
+ return 0;
+#endif
if (unlikely(curr->lockdep_depth >= MAX_LOCK_DEPTH)) {
debug_locks_off();
printk("BUG: MAX_LOCK_DEPTH too low!\n");