Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp30870rdb; Wed, 29 Nov 2023 18:49:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmXjJHMEtz4CGZdrpZcpQ7vtDfKfBA3WEgtQSu791QDqocYWLCi8efUn4kirfUTpPL0AsY X-Received: by 2002:a05:6808:202a:b0:3b8:42f2:408e with SMTP id q42-20020a056808202a00b003b842f2408emr26397519oiw.42.1701312561000; Wed, 29 Nov 2023 18:49:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701312560; cv=none; d=google.com; s=arc-20160816; b=I0rEsKvvy11PlB1CJqBOzukYyTtJinQfluEXus8YjuFJOXoweL5cJcJeiD5aoghKOD LthZAWF4I4Hgdjuu0Nm0r/2XhXHPas7cuP8Jr6maWJlDcs2XkypmePq57Vqak35n6xMc b9CIVGloUIyPeHBNbffGcWp48fPmog698CvOyeMXxeY1Vmr93ykgBMIQ8wQameMGZrns UGjp/T36vLzG9ixM/FUSAbaaEs+8eG/DaCCmX7lGPj3drsMikUD5SkcyraxRaaoezWrY FpHIilDbGPUI4CbOqkSV2wq5GSQPbqLyRY9EDlhXATI/Y3eq3t+gkzLPl5Ldk+73efGQ z5hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:subject:user-agent:mime-version:date:message-id; bh=6V3nWNLvdCYlJXVBaK+wogpX260EMI1V34+61HhuynI=; fh=YrEURh7gYKsHMRq69/kC785jAx7LHjA4L8EhvSmxXL8=; b=mR3SHwuRp8DSqOY9wthG5oGH9ECWfYKa6Ht85EH1YOnT2nJ3ycHrEYivLiWBePsE4A c3ovX1/xgPIjA5nSFXRW97v75EGXmcgn3EXnkQIdPGnMqmTKKeexOQtGUdW6OjNeFuD8 YNCWQ0gMjse537jSksn8QfTFG/eUHM/5RrWLVSf3MNJeMDlIuI57I9N0WIETQ0lnGUhF c0MswP05K2EzSvlYhGExsLTnvCSSjVduPWKqAJaaY3YGgNekZ6BBcT4TmfvHXeLoEIaE qm2gcEiZ+xHONpXXVfWB9neSxhHdNIQtkqKeAJwDfPW5n+ssf2K2PhGEU/Y6bw6gUYmI mkqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id h2-20020a63e142000000b005c179c0075dsi247816pgk.883.2023.11.29.18.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 18:49:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6955A802A82F; Wed, 29 Nov 2023 18:49:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344173AbjK3CtK (ORCPT + 99 others); Wed, 29 Nov 2023 21:49:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230393AbjK3CtJ (ORCPT ); Wed, 29 Nov 2023 21:49:09 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD9DCCA for ; Wed, 29 Nov 2023 18:49:13 -0800 (PST) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SggcB0fcTzWhwW; Thu, 30 Nov 2023 10:48:26 +0800 (CST) Received: from [10.174.176.88] (10.174.176.88) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 30 Nov 2023 10:49:10 +0800 Message-ID: <9f954701-62e0-4815-8e28-3ed75be07337@huawei.com> Date: Thu, 30 Nov 2023 10:49:10 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH -next,V2] cachefiles: support to disable assert macro From: Zizhi Wo To: CC: , , , References: <20231101163431.2108688-1-wozizhi@huawei.com> <029f5c1c-6251-4112-8ce0-ef3d46596089@huawei.com> In-Reply-To: <029f5c1c-6251-4112-8ce0-ef3d46596089@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.176.88] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500020.china.huawei.com (7.185.36.49) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 29 Nov 2023 18:49:19 -0800 (PST) friendly ping 在 2023/11/7 18:17, Zizhi Wo 写道: > friendly ping > > 在 2023/11/2 0:34, WoZ1zh1 写道: >> In fs/cachefiles/internal.h, ASSERT macro is enabled by default and can >> not be disabled, then assert failure will crash the kernel as the BUG() >> is included in the ASSERT macro. Therefore, add CACHEFILES_ASSERT to >> control it. >> >> Signed-off-by: WoZ1zh1 >> --- >>   fs/cachefiles/Kconfig    | 11 +++++++++++ >>   fs/cachefiles/internal.h |  2 +- >>   2 files changed, 12 insertions(+), 1 deletion(-) >> >> diff --git a/fs/cachefiles/Kconfig b/fs/cachefiles/Kconfig >> index 8df715640a48..83d8ec3ba2d8 100644 >> --- a/fs/cachefiles/Kconfig >> +++ b/fs/cachefiles/Kconfig >> @@ -38,3 +38,14 @@ config CACHEFILES_ONDEMAND >>         and is delegated to userspace. >>         If unsure, say N. >> + >> +config CACHEFILES_ASSERT >> +    bool "CACHEFILES asserts" >> +    default n >> +    depends on CACHEFILES >> +    help >> +      Support the ASSERT mode for failure behavior. >> +      Say N here to disable the ASSERT by default. >> +      Say Y to add assertion checks in some places. But the assertion >> +      failure will result in fatal errors that BUG() the kernel. >> + >> diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h >> index 2ad58c465208..263b1f13e943 100644 >> --- a/fs/cachefiles/internal.h >> +++ b/fs/cachefiles/internal.h >> @@ -425,7 +425,7 @@ do {                            \ >>   #define _debug(FMT, ...) no_printk(FMT, ##__VA_ARGS__) >>   #endif >> -#if 1 /* defined(__KDEBUGALL) */ >> +#ifdef CONFIG_CACHEFILES_ASSERT >>   #define ASSERT(X)                            \ >>   do {                                    \