Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754568AbbLBGDy (ORCPT ); Wed, 2 Dec 2015 01:03:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59016 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbbLBGDw (ORCPT ); Wed, 2 Dec 2015 01:03:52 -0500 Subject: Re: [PATCH 1/2] kexec: Set KEXEC_TYPE_CRASH before sanity_check_segment_list() To: Dave Young References: <1449033995-15700-1-git-send-email-xlpang@redhat.com> <20151202054745.GA2899@dhcp-128-65.nay.redhat.com> Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org, Eric Biederman , akpm@linux-foundation.org From: Xunlei Pang Message-ID: <565E89C3.40608@redhat.com> Date: Wed, 2 Dec 2015 14:03:47 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151202054745.GA2899@dhcp-128-65.nay.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2041 Lines: 70 Hi Dave, On 12/02/2015 at 01:47 PM, Dave Young wrote: > Ccing Andrew since usually he monitors and picks up kexec patches. > > On 12/02/15 at 01:26pm, 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. > Looks good except a nitpick, see comments inline. > > Otherwise: > Acked-by: Dave Young > >> Signed-off-by: Xunlei Pang >> --- >> kernel/kexec.c | 13 ++++++++----- >> 1 file changed, 8 insertions(+), 5 deletions(-) >> >> diff --git a/kernel/kexec.c b/kernel/kexec.c >> index d873b64..9624391 100644 >> --- a/kernel/kexec.c >> +++ b/kernel/kexec.c >> @@ -63,16 +63,19 @@ 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. */ >> + /* >> + * Enable the special crash kernel control page allocation policy, >> + * and set the crash type flag. > It is obvious it is setting the crash type flag, so no need to add extra > comment. > >> + */ >> if (kexec_on_panic) { > Like kexec_file.c, move /* Enable ... policy */ here sounds better. Yea, this is better. Will do, thanks. Regards, Xunlei > >> image->control_page = crashk_res.start; >> image->type = KEXEC_TYPE_CRASH; >> } >> >> + 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 >> > Thanks > Dave -- 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/