Skip to content

Commit

Permalink
kernel/panic: call the 2nd crash_kexec() only if crash_kexec_post_not…
Browse files Browse the repository at this point in the history
…ifiers 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>
  • Loading branch information
HATAYAMA Daisuke authored and torvalds committed Jul 1, 2015
1 parent a846f47 commit f45d85f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ 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.
*/
crash_kexec(NULL);
if (crash_kexec_post_notifiers)
crash_kexec(NULL);

bust_spinlocks(0);

Expand Down

0 comments on commit f45d85f

Please sign in to comment.