aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-05-12 15:21:00 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 15:50:21 -0400
commitbb065afb8ebd07a03155502dba29ebf0f6fe67e8 (patch)
treeaa32a9461cd38f336797cfba4d07c58789a6f1be
parenta98a3c3fde3ae7614f19758a043691b6f59dac53 (diff)
lockdep: update lockdep_recursion on graph_lock
With the introduction of ftrace, it is possible to recurse into the lockdep functions via the mcount call. To prevent possible lockups, updating the lockdep_recursion counter on grabbing the internal lockdep_lock should prevent deadlocks. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--kernel/lockdep.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 90a440cbd6de..65548eff029e 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -82,6 +82,8 @@ static int graph_lock(void)
82 __raw_spin_unlock(&lockdep_lock); 82 __raw_spin_unlock(&lockdep_lock);
83 return 0; 83 return 0;
84 } 84 }
85 /* prevent any recursions within lockdep from causing deadlocks */
86 current->lockdep_recursion++;
85 return 1; 87 return 1;
86} 88}
87 89
@@ -90,6 +92,7 @@ static inline int graph_unlock(void)
90 if (debug_locks && !__raw_spin_is_locked(&lockdep_lock)) 92 if (debug_locks && !__raw_spin_is_locked(&lockdep_lock))
91 return DEBUG_LOCKS_WARN_ON(1); 93 return DEBUG_LOCKS_WARN_ON(1);
92 94
95 current->lockdep_recursion--;
93 __raw_spin_unlock(&lockdep_lock); 96 __raw_spin_unlock(&lockdep_lock);
94 return 0; 97 return 0;
95} 98}