[PATCH] lockdep: fix possible races while disabling lock-debugging
authorIngo Molnar <mingo@elte.hu>
Wed, 13 Dec 2006 08:34:43 +0000 (00:34 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Wed, 13 Dec 2006 17:05:50 +0000 (09:05 -0800)
commit74c383f1400f559562aa517d6d62f77245bddf52
tree031f6524f0fba31c980bd3d00cc1e6b433d3d2c5
parent3117df0453828bd045c16244e6f50e5714667a8a
[PATCH] lockdep: fix possible races while disabling lock-debugging

Jarek Poplawski noticed that lockdep global state could be accessed in a
racy way if one CPU did a lockdep assert (shutting lockdep down), while the
other CPU would try to do something that changes its global state.

This patch fixes those races and cleans up lockdep's internal locking by
adding a graph_lock()/graph_unlock()/debug_locks_off_graph_unlock helpers.

(Also note that as we all know the Linux kernel is, by definition, bug-free
and perfect, so this code never triggers, so these fixes are highly
theoretical.  I wrote this patch for aesthetic reasons alone.)

[akpm@osdl.org: build fix]
[jarkao2@o2.pl: build fix's refix]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/lockdep.c