• Ingo Molnar's avatar
    [PATCH] lockdep: fix possible races while disabling lock-debugging · 74c383f1
    Ingo Molnar authored
    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: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarJarek Poplawski <jarkao2@o2.pl>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    74c383f1
lockdep.c 68.7 KB