Skip to contentSkip to conversation

panic: Avoid dump_stack() twice

PATCH In review Kefeng Wang 2 participants 3 messages Nov 13, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 panic: Avoid dump_stack() twice

stacktrace will be dumped twice on ARM64 after commit 3f388f28639f ("panic: dump registers on panic_on_warn"), will not dump_stack when no regs as before.

Fixes 3f388f28639f ("panic: dump registers on panic_on_warn")
---
 kernel/panic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/panic.c +2 -1
index 396142ee43fd..332736a72a58 100644
@@ -605,7 +605,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
 		panic("panic_on_warn set ...\n");
 	}
 
-	dump_stack();
+	if (!regs)
+		dump_stack();
 
 	print_irqtrace_events(current);
 
Signature · 1 line
2.26.2
#1 lore raw

Fixed already

https://ozlabs.org/~akpm/mmots/broken-out/panic-dont-dump-stack-twice-on-warn.patch

Sorry for breaking this :(

Quoted 25 lines · Kefeng Wang

stacktrace will be dumped twice on ARM64 after commit 3f388f28639f ("panic: dump registers on panic_on_warn"), will not dump_stack when no regs as before.

Fixes 3f388f28639f ("panic: dump registers on panic_on_warn")
---
  kernel/panic.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
kernel/panic.c +2 -1
index 396142ee43fd..332736a72a58 100644
@@ -605,7 +605,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
  		panic("panic_on_warn set ...\n");
  	}
 
-	dump_stack();
+	if (!regs)
+		dump_stack();
 
  	print_irqtrace_events(current);
 
Signature · 1 line
Alexey