Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2782819pxb; Mon, 25 Apr 2022 02:16:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9U3Fy/W0Ri0bGoxX1gb98r224g0wTFnnCzCaNSVw5rkTu4goOzCor+ifaUmN4T67r4iTg X-Received: by 2002:a63:b811:0:b0:3aa:fecf:783c with SMTP id p17-20020a63b811000000b003aafecf783cmr8324034pge.11.1650878195496; Mon, 25 Apr 2022 02:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650878195; cv=none; d=google.com; s=arc-20160816; b=lqiT152bzuNnWWX2x5zhHfoPvtJIYcUIpiTTNRuCb+vLJFfjMF/sihB15uD20HWItv aCRx6x4Vx0Xgx/dR4UY1d7RN/LPfUUqvNV/jABCQ1u0wjscHmzMWDzsJxiCBlsFklbp8 FEeYYGZKVDefvt8zIXPQbkJYGtnJU/AOKNLdegVCMjPzAgpCLk53ReAwcHFbRb94zr5K 2pT2ykqesGUN4//okVLcw7Et6o5Z3l4u9l8G6zmSh+Lb5vcnKkk0ilg9G8+5a8ZeVdMK /sAiHBmRaG/siBD40gKL79N0HqRmo3ZrBxsCjnfeikEbdPBO4ro651oE5lLQ0trmDmti 95gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6+BjK5j3p07NV8YTOKQRJe/TLrsI/cMPaYzFnvSMXsY=; b=nNThIBsom+Xc1yTeZoXGHrtZl9nnUSt1+hx6LLSQoA6fmOjng0HKSmFf9Crarwx2pd hnd90mWEhZDSYtISOvFeaLZUJmNhJS6ILQLhNKW7B+AI3Uo0pi8/2w0oHo3vMmx9VMr5 MhfbUep77ifw8AD56iP2ZBrcwtGWpiDmmTCaofjJ9p7zTtpHqnPVaCkf1+PjfWCMn3am a8ZNpaesd3HQ6uUclEHjrZVFwTzo9Gp/3gFqa5khjEmuQHnvIvF8RmdZxPcANm+jZqXE hqgX9fN6DjjWVswm86pZ1fKJ1AzAO32DwwZE4K/SKPyH6/cSfEQfQYcLYoAy1MdfZ0ZG iGkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aTq2xpoi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mi12-20020a17090b4b4c00b001d26ee86442si15922966pjb.93.2022.04.25.02.16.19; Mon, 25 Apr 2022 02:16:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aTq2xpoi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240689AbiDYDxH (ORCPT + 99 others); Sun, 24 Apr 2022 23:53:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231730AbiDYDxE (ORCPT ); Sun, 24 Apr 2022 23:53:04 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 73F502F021 for ; Sun, 24 Apr 2022 20:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650858600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6+BjK5j3p07NV8YTOKQRJe/TLrsI/cMPaYzFnvSMXsY=; b=aTq2xpoiL1fV+LGJAJxSgdALkp2FfcztOy2w2EcQ9xvJUhgi+c4VgdWSAfu/gXoctmIwSu M3CyevPvVtFASmBTCNbg9KpsLIfRp9GIIqI1CL/lbUh3vegAk1Q7WnKOUKqMWbPzbaLumx 1mXg5SjAYWJ2ectCh+XfinKEhK9o3Q4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-671-66BGPX6ZN3KzlUNj4q2GrQ-1; Sun, 24 Apr 2022 23:49:54 -0400 X-MC-Unique: 66BGPX6ZN3KzlUNj4q2GrQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4C3E13810D40; Mon, 25 Apr 2022 03:49:53 +0000 (UTC) Received: from localhost (ovpn-12-73.pek2.redhat.com [10.72.12.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C317755105D; Mon, 25 Apr 2022 03:49:51 +0000 (UTC) Date: Mon, 25 Apr 2022 11:49:48 +0800 From: Baoquan He To: Zhen Lei Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , linux-kernel@vger.kernel.org, Dave Young , Vivek Goyal , Eric Biederman , kexec@lists.infradead.org, Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Randy Dunlap , Feng Zhou , Kefeng Wang , Chen Zhou , John Donnelly , Dave Kleikamp Subject: Re: [PATCH v22 1/9] kdump: return -ENOENT if required cmdline option does not exist Message-ID: References: <20220414115720.1887-1-thunder.leizhen@huawei.com> <20220414115720.1887-2-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220414115720.1887-2-thunder.leizhen@huawei.com> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/14/22 at 07:57pm, Zhen Lei wrote: > According to the current crashkernel=Y,low support in other ARCHes, it's > an optional command-line option. When it doesn't exist, kernel will try > to allocate minimum required memory below 4G automatically. > > However, __parse_crashkernel() returns '-EINVAL' for all error cases. It > can't distinguish the nonexistent option from invalid option. > > Change __parse_crashkernel() to return '-ENOENT' for the nonexistent option > case. With this change, crashkernel,low memory will take the default > value if crashkernel=,low is not specified; while crashkernel reservation > will fail and bail out if an invalid option is specified. > > Signed-off-by: Zhen Lei Acked-by: Baoquan He > --- > kernel/crash_core.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > index 256cf6db573cd09..4d57c03714f4e13 100644 > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -243,9 +243,8 @@ static int __init __parse_crashkernel(char *cmdline, > *crash_base = 0; > > ck_cmdline = get_last_crashkernel(cmdline, name, suffix); > - > if (!ck_cmdline) > - return -EINVAL; > + return -ENOENT; > > ck_cmdline += strlen(name); > > -- > 2.25.1 >