Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp926989pxp; Wed, 16 Mar 2022 21:35:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvhj9HShUhH+HLK6vYiKmEDGMKMVX8Nb/CRm1yDT5Uk8lMNlcWami2F9QkUs+Dq2YEe6LO X-Received: by 2002:a17:90b:4d09:b0:1c3:801a:8415 with SMTP id mw9-20020a17090b4d0900b001c3801a8415mr13975507pjb.108.1647491712922; Wed, 16 Mar 2022 21:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647491712; cv=none; d=google.com; s=arc-20160816; b=FaECJpNeEnSf4sOk4fqrvteAP5XNJK1twqlMfTMKJKitPvy4BY2tRodPiyYR/7XU1D l3o0G7Pq1KRrj5liciiPreZ7qrCnHCTjDgckmgpHibrwXPwSoIN6c89sUaLiE4md1JI7 7dM7fDGBJ6Db2jJ3SS/kRAKOaVgiF3PpPUmEi8S7CC6bF6RH+92aigTOQX8Dg2R/p2ls GzkF9HrAOT7CHq8rYwJQe7+X4YOXfRRH8llKOdvYCzIO1ssVSdbTloQvpi0hhpdPiXXx X2z1YGY1kArNzz9poRV6loODhrAtJvnOQR1E2eGZ+ygJeksGt66GDYdMaeBzVKKMrcQi BESw== 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=AWzW/AiFghgBpQmEgCb3aWpx2QwBfw3FXug4mOjTdG8=; b=GrkMxI3RJDgMGngpBr7ybcZo92UdQDq3nIuP1uCZkcku6b2M1He36Uj1DGjI/ekyS6 BOwmu8HZRe/LyyTqitvcVObBD9RbylyPhOtGREqK4sEE9JZdKlVdSC/RPFFy3ilgPf2A nYelRg2uhSl5IDsNUZauB4++CKelW60IMRMPj4+biMA2X+RPCH8o0zjrlsn3OtEsnNbX zNd6O8Vd3CsVJefDAkbc75szjQ22UR2HKLfzHUSBE1fToZj+HrTo+kUB+ZM1UMxEVqhD 5MlBB/pY7gvNcMOzSpJjMlBlAbbww02ccNZMd/Hvxa0L05rE34t5EoPvImbDHO0cwBMb 5a/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bVd7XFOg; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u136-20020a63798e000000b003816043efb7si1084185pgc.428.2022.03.16.21.35.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 21:35:12 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bVd7XFOg; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3087E8D68C; Wed, 16 Mar 2022 21:02:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349775AbiCPFlI (ORCPT + 99 others); Wed, 16 Mar 2022 01:41:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237378AbiCPFlH (ORCPT ); Wed, 16 Mar 2022 01:41:07 -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 D32B45FF33 for ; Tue, 15 Mar 2022 22:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647409193; 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=AWzW/AiFghgBpQmEgCb3aWpx2QwBfw3FXug4mOjTdG8=; b=bVd7XFOg04kqNTDzRDhREOwROpNsiKPVxNqwiLCfWLiWISPP4y0qFbKaDwEAL7a6sT2GTU PZ0EZStzuE2rG5NmdMjySySvkv4REhin+iNz8R8oessl5AIOr+u1i3XoAb9rAx63sQcnhp oe4oxFBQJh/rfjpr7MuZ4Gdv3s+GogA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-377-Qv-RiQxdOImnaY6CTmAwsQ-1; Wed, 16 Mar 2022 01:39:49 -0400 X-MC-Unique: Qv-RiQxdOImnaY6CTmAwsQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E783282A6C2; Wed, 16 Mar 2022 05:39:48 +0000 (UTC) Received: from localhost (ovpn-13-134.pek2.redhat.com [10.72.13.134]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9091C26E80; Wed, 16 Mar 2022 05:39:47 +0000 (UTC) Date: Wed, 16 Mar 2022 13:39:44 +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 v21 1/5] kdump: return -ENOENT if required cmdline option does not exist Message-ID: References: <20220227030717.1464-1-thunder.leizhen@huawei.com> <20220227030717.1464-2-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220227030717.1464-2-thunder.leizhen@huawei.com> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 02/27/22 at 11:07am, Zhen Lei wrote: > The crashkernel=Y,low is an optional command-line option. When it doesn't > exist, kernel will try to allocate minimum required memory below 4G > automatically. Give it a unique error code to distinguish it from other > error scenarios. This log is a little confusing. __parse_crashkernel() has three callers. - parse_crashkernel() - parse_crashkernel_high() - parse_crashkernel_low() How about tuning the git log as below: ================== 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 > --- > kernel/crash_core.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > > Signed-off-by: Zhen Lei > --- > 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 >