Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933904AbbEOLMJ (ORCPT ); Fri, 15 May 2015 07:12:09 -0400 Received: from mgwym01.jp.fujitsu.com ([211.128.242.40]:32772 "EHLO mgwym01.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754444AbbEOLMG (ORCPT ); Fri, 15 May 2015 07:12:06 -0400 X-Greylist: delayed 619 seconds by postgrey-1.27 at vger.kernel.org; Fri, 15 May 2015 07:12:05 EDT Subject: [PATCH v3 1/2] kernel/panic: call the 2nd crash_kexec() only if crash_kexec_post_notifiers is enabled From: HATAYAMA Daisuke To: akpm@linux-foundation.org, ebiederm@xmission.com, vgoyal@redhat.com, mingo@kernel.org Cc: masami.hiramatsu.pt@hitachi.com, hidehiro.kawai.ez@hitachi.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, bhe@redhat.com Date: Fri, 15 May 2015 20:01:44 +0900 Message-ID: <20150515110143.8431.38836.stgit@localhost6.localdomain6> In-Reply-To: <20150515105953.8431.65220.stgit@localhost6.localdomain6> References: <20150515105953.8431.65220.stgit@localhost6.localdomain6> User-Agent: StGit/0.17-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1273 Lines: 35 For compatibility with the behaviour before the commit f06e5153f4ae2e2f3b0300f0e260e40cb7fefd45, 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 Suggested-by: Ingo Molnar --- kernel/panic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/panic.c b/kernel/panic.c index 8136ad7..774614f 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/