]> err.no Git - linux-2.6/blobdiff - kernel/lockdep.c
lockdep: fix debug_show_all_locks()
[linux-2.6] / kernel / lockdep.c
index 55fe0c7cd95fc6776dda4f93d85fa1541200ebb1..7e2ca7c9d99c242ea249f9f99c18531a6c97b5a3 100644 (file)
@@ -2424,7 +2424,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
                return 0;
 
        /*
-        * Calculate the chain hash: it's the combined has of all the
+        * Calculate the chain hash: it's the combined hash of all the
         * lock keys along the dependency chain. We save the hash value
         * at every step so that we can get the current hash easily
         * after unlock. The chain hash is then used to cache dependency
@@ -3173,6 +3173,13 @@ retry:
                printk(" locked it.\n");
 
        do_each_thread(g, p) {
+               /*
+                * It's not reliable to print a task's held locks
+                * if it's not sleeping (or if it's not the current
+                * task):
+                */
+               if (p->state == TASK_RUNNING && p != current)
+                       continue;
                if (p->lockdep_depth)
                        lockdep_print_held_locks(p);
                if (!unlock)