Commit:     9c35dd7f8bda1849dcb430be99325504221048df
Parent:     b43376927ab0f7b64c4fb304568ecfaea10446e2
Author:     Jarek Poplawski <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 22 00:11:28 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Mar 22 19:39:06 2007 -0700

    [PATCH] lockdep: debug_show_all_locks & debug_show_held_locks vs. 
    lockdep's data shouldn't be used when debug_locks == 0 because it's not
    updated after this, so it's more misleading than helpful.
    PS: probably lockdep's current-> fields should be reset after it turns
    debug_locks off: so, after printing a bug report, but before return from
    exported functions, but there are really a lot of these possibilities (e.g.
     after DEBUG_LOCKS_WARN_ON), so, something could be missed.  (Of course
    direct use of this fields isn't recommended either.)
    Reported-by: Folkert van Heusden <[EMAIL PROTECTED]>
    Inspired-by: Oleg Nesterov <[EMAIL PROTECTED]>
    Signed-off-by: Jarek Poplawski <[EMAIL PROTECTED]>
    Acked-by: Peter Zijlstra <[EMAIL PROTECTED]>
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 kernel/lockdep.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 8dc24c9..7065a68 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -2742,6 +2742,10 @@ void debug_show_all_locks(void)
        int count = 10;
        int unlock = 1;
+       if (unlikely(!debug_locks)) {
+               printk("INFO: lockdep is turned off.\n");
+               return;
+       }
        printk("\nShowing all locks held in the system:\n");
@@ -2785,6 +2789,10 @@ EXPORT_SYMBOL_GPL(debug_show_all_locks);
 void debug_show_held_locks(struct task_struct *task)
+       if (unlikely(!debug_locks)) {
+               printk("INFO: lockdep is turned off.\n");
+               return;
+       }
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to