2020-11-13 05:47:06

by Kefeng Wang

[permalink] [raw]
Subject: [PATCH] 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")
Signed-off-by: Kefeng Wang <[email protected]>
---
kernel/panic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 396142ee43fd..332736a72a58 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -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);

--
2.26.2


2020-11-13 06:42:12

by Alexey Kardashevskiy

[permalink] [raw]
Subject: Re: [PATCH] panic: Avoid dump_stack() twice

Fixed already

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

Sorry for breaking this :(


On 13/11/2020 16:47, Kefeng Wang wrote:
> 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")
> Signed-off-by: Kefeng Wang <[email protected]>
> ---
> kernel/panic.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/panic.c b/kernel/panic.c
> index 396142ee43fd..332736a72a58 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -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);
>
>

--
Alexey

2020-11-13 06:53:53

by Kefeng Wang

[permalink] [raw]
Subject: Re: [PATCH] panic: Avoid dump_stack() twice


On 2020/11/13 14:39, Alexey Kardashevskiy wrote:
> Fixed already
>
> https://ozlabs.org/~akpm/mmots/broken-out/panic-dont-dump-stack-twice-on-warn.patch
>
>
> Sorry for breaking this :(
>
OK.