Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp898505pxp; Wed, 16 Mar 2022 20:34:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyO4vEf4Js8Ev35ssr0tT5nLaHHF6Z0I3i3SXw8u7VOw8BqGyYD9OZOHTqhaeQ0T53l+VB6 X-Received: by 2002:a63:3107:0:b0:381:d462:8240 with SMTP id x7-20020a633107000000b00381d4628240mr2093324pgx.347.1647488093709; Wed, 16 Mar 2022 20:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647488093; cv=none; d=google.com; s=arc-20160816; b=xGp8ChzS6q50pbfkvHDJacnifku3Q70oMKNsUy1dFGZt7o6OaKBKakk+bI+xdRjpiH yuJkof7cr6eVtSXEtcV8PjP9SO4DgjSr/EviXa+HgTKXERatb9lSC4hPJBiYTFogbcBx mMmGjKkBv+TfE48HXfRpoLRyEQCGbzSyBrx03nFSpwBTs1laE7Va+g1ApS9a8otQvNMr x7Eevs0RkwDG/m/wu5A8WAMtRRXKhTYzUPOoOeGb41wD002uaIM6/h0TH5VAz6V+lEz0 H+XUTPv22IDocvPGVZwCL+DMLiS0aILZwkzfR/pl/Udw37Hog6jcL2dOrXP1SnEhkEv0 ykVQ== 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=2FtWagwkwgX0MltETfIs1AByeqI6nXJsssWt9g1O7mo=; b=Gux1BVtd0kttcW8OJkdy8vAj+t4xjHr3Y9EL3NAukVLYcF78aaf+Uxr1GmozYUrjgd OGHOj0pQdAE8r10TC7h9xqd2s2w55GGgXJRcqLpxPrd/Pp0Z/uVYawNVZ9LsUUdyW+lL 4jOoxcUz20WZNxAjIl2uJ7Nz35D/DvqbdYH+5IC3Euu9esPkGba7fMeINDMi4rshpBz9 3qxm7LQA2Vut+6oHjCMikZf7lPLEsuF4JruWcz9AXMHxFvh4YrjPYSqW32Ln128emMxl kpkdzcOD2eHi1fkYhXj/XXPO7EyOuYR5JbsC2tMy6W71VBOa7oQz/PpIYvfwJW3BejPv bJBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ay4/iD/l"; 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 w4-20020a17090a5e0400b001bd14e01fa6si6497144pjf.148.2022.03.16.20.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 20:34:53 -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="ay4/iD/l"; 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 549C839B90; Wed, 16 Mar 2022 20:30:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348102AbiCOL7T (ORCPT + 99 others); Tue, 15 Mar 2022 07:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348100AbiCOL7Q (ORCPT ); Tue, 15 Mar 2022 07:59:16 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5F46513EB3 for ; Tue, 15 Mar 2022 04:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647345483; 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=2FtWagwkwgX0MltETfIs1AByeqI6nXJsssWt9g1O7mo=; b=ay4/iD/l86+GJG5fJZZw//aCpLK6x1/AlvPhkybYHidi3QzVdzuTVTvn85IwRMWkW54/OE t5+gvqA6H1jVzaSOYtpubdESkHQ21wN0veXfAq5OHFwGWYp/HMCA1lYaFkfP2djurx+rIk yq5FUhc3sKeUCJOLu1HCnApHHGCQt2g= 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-218-fGbAOanoNcKg9MmMCcJeiQ-1; Tue, 15 Mar 2022 07:57:58 -0400 X-MC-Unique: fGbAOanoNcKg9MmMCcJeiQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 192D7811E84; Tue, 15 Mar 2022 11:57:57 +0000 (UTC) Received: from localhost (ovpn-12-225.pek2.redhat.com [10.72.12.225]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A1E4B40C1247; Tue, 15 Mar 2022 11:57:55 +0000 (UTC) Date: Tue, 15 Mar 2022 19:57:52 +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.84 on 10.11.54.2 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. > > 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; Firstly, I am not sure if '-ENOENT' is a right value to return. From the code comment of ENOENT, it's used for file or dir? #define ENOENT 2 /* No such file or directory */ Secondly, we ever discussed the case including - no crashkernel=,low is provided; - messy code is provied, e.g crashkernel=aaaaaabbbb,low The 2nd one is not handled in this patchset. How about taking the handling into another round of patches. This patchset just adds crashkernel=,high purely. > > ck_cmdline += strlen(name); > > -- > 2.25.1 >