aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/lockdep.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2007-12-05 09:46:09 -0500
committerIngo Molnar <mingo@elte.hu>2007-12-05 09:46:09 -0500
commit856848737bd944c1db3ce0a66bbf67e56bd6f77d (patch)
tree4fce302f29225f7d1d558559e40e73dadc40e60e /kernel/lockdep.c
parent41a2d6cfa3f77ec469e7e5f06b4d7ffd031f9c0e (diff)
lockdep: fix debug_show_all_locks()
fix the oops that can be seen in: http://bugzilla.kernel.org/attachment.cgi?id=13828&action=view it is not safe to print the locks of running tasks. (even with this fix we have a small race - but this is a debug function after all.) Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r--kernel/lockdep.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index ed38bbfc48a3..7e2ca7c9d99c 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -3173,6 +3173,13 @@ retry:
3173 printk(" locked it.\n"); 3173 printk(" locked it.\n");
3174 3174
3175 do_each_thread(g, p) { 3175 do_each_thread(g, p) {
3176 /*
3177 * It's not reliable to print a task's held locks
3178 * if it's not sleeping (or if it's not the current
3179 * task):
3180 */
3181 if (p->state == TASK_RUNNING && p != current)
3182 continue;
3176 if (p->lockdep_depth) 3183 if (p->lockdep_depth)
3177 lockdep_print_held_locks(p); 3184 lockdep_print_held_locks(p);
3178 if (!unlock) 3185 if (!unlock)