Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754030AbbLKC7v (ORCPT ); Thu, 10 Dec 2015 21:59:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44007 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753468AbbLKC7t (ORCPT ); Thu, 10 Dec 2015 21:59:49 -0500 Date: Fri, 11 Dec 2015 10:59:45 +0800 From: Baoquan He To: Xunlei Pang Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org, akpm@linux-foundation.org, Dave Young , Eric Biederman Subject: Re: [PATCH v2] kexec: Set KEXEC_TYPE_CRASH before sanity_check_segment_list() Message-ID: <20151211025945.GB2544@x1.redhat.com> References: <1449045576-18829-1-git-send-email-xlpang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1449045576-18829-1-git-send-email-xlpang@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1920 Lines: 63 On 12/02/15 at 04:39pm, Xunlei Pang wrote: > sanity_check_segment_list() checks KEXEC_TYPE_CRASH flag to ensure > all the segments of the loaded crash kernel are winthin the kernel > crash resource limits, so set the flag beforehand. > > Signed-off-by: Xunlei Pang > Acked-by: Dave Young > --- > v1 -> v2: > Improved some comments. > > kernel/kexec.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/kernel/kexec.c b/kernel/kexec.c > index d873b64..ee70aef 100644 > --- a/kernel/kexec.c > +++ b/kernel/kexec.c > @@ -63,16 +63,16 @@ static int kimage_alloc_init(struct kimage **rimage, unsigned long entry, > if (ret) > goto out_free_image; > > - ret = sanity_check_segment_list(image); > - if (ret) > - goto out_free_image; > - > - /* Enable the special crash kernel control page allocation policy. */ > if (kexec_on_panic) { > + /* Enable special crash kernel control page alloc policy. */ > image->control_page = crashk_res.start; > image->type = KEXEC_TYPE_CRASH; > } Good catch. This is hard to be found because kexec-tools user space utility has make sure it's well located. It must be a code reviewing finding. Ack it. Acked-by: Baoquan He Thanks Baoquan > > + ret = sanity_check_segment_list(image); > + if (ret) > + goto out_free_image; > + > /* > * Find a location for the control code buffer, and add it > * the vector of segments so that it's pages will also be > -- > 2.5.0 > > > _______________________________________________ > kexec mailing list > kexec@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kexec -- 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/