Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f45d85ff authored by HATAYAMA Daisuke's avatar HATAYAMA Daisuke Committed by Linus Torvalds
Browse files

kernel/panic: call the 2nd crash_kexec() only if crash_kexec_post_notifiers is enabled



For compatibility with the behaviour before the commit f06e5153
("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: default avatarHATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Suggested-by: default avatarIngo 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a846f479
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ void panic(const char *fmt, ...)
	 * Note: since some panic_notifiers can make crashed kernel
	 * more unstable, it can increase risks of the kdump failure too.
	 */
	if (crash_kexec_post_notifiers)
		crash_kexec(NULL);

	bust_spinlocks(0);