Skip to content

Commit f45d85f

Browse files
HATAYAMA Daisuketorvalds
authored andcommitted
kernel/panic: call the 2nd crash_kexec() only if crash_kexec_post_notifiers is enabled
For compatibility with the behaviour before the commit f06e515 ("kernel/panic.c: add "crash_kexec_post_notifiers" option for kdump after panic_notifers"), the 2nd crash_kexec() should be called only if crash_kexec_post_notifiers is enabled. Note that crash_kexec() returns immediately if kdump crash kernel is not loaded, so in this case, this patch makes no functionality change, but the point is to make it explicit, from the caller panic() side, that the 2nd crash_kexec() does nothing. Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> Suggested-by: Ingo Molnar <mingo@kernel.org> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com> Cc: Baoquan He <bhe@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a846f47 commit f45d85f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎kernel/panic.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ void panic(const char *fmt, ...)
142142
* Note: since some panic_notifiers can make crashed kernel
143143
* more unstable, it can increase risks of the kdump failure too.
144144
*/
145-
crash_kexec(NULL);
145+
if (crash_kexec_post_notifiers)
146+
crash_kexec(NULL);
146147

147148
bust_spinlocks(0);
148149

0 commit comments

Comments
 (0)