From: Andi Kleen Date: Tue, 26 Sep 2006 08:52:34 +0000 (+0200) Subject: [PATCH] Avoid recursion in lockdep when stack tracer takes locks X-Git-Tag: v2.6.19-rc1~1077^2~116 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fa7c794fe4dc127f7fac3fad4d13628e68f89ce;p=linux-2.6 [PATCH] Avoid recursion in lockdep when stack tracer takes locks The new dwarf2 unwinder needs to take locks to do backtraces inside modules. This patch makes sure lockdep which calls stacktrace is not reentered. Thanks to Ingo for suggesting this simpler approach. Cc: mingo@elte.hu Signed-off-by: Andi Kleen --- diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 900b4cb1a0..c088e5542e 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c @@ -227,7 +227,11 @@ static int save_trace(struct stack_trace *trace) trace->skip = 3; trace->all_contexts = 0; + /* Make sure to not recurse in case the the unwinder needs to tak +e locks. */ + lockdep_off(); save_stack_trace(trace, NULL); + lockdep_on(); trace->max_entries = trace->nr_entries;