Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp355786rdb; Thu, 25 Jan 2024 18:49:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRn0+bJbsNGz70rNIRhz/Siy2E23utnnXozWqdnYEwGe8RvXXN+3Mr1dupUAnU1PqYd75y X-Received: by 2002:a05:600c:b4b:b0:40e:540a:dc22 with SMTP id k11-20020a05600c0b4b00b0040e540adc22mr375288wmr.182.1706237398425; Thu, 25 Jan 2024 18:49:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706237398; cv=pass; d=google.com; s=arc-20160816; b=MDbTbhk7t5c8RKklT0RgVk4ku4NR03jlyt3IqB0tkiwsruDVm9ameRyPXwtj241hN7 MGY2cmOMRxsQh6uj2QcagbYQK6swWHTednQGhLFHk+S7ev6J021UoKHTUO58wAgV9RMb tgDiXmdvZ70mVIxIq4JqD0Vp9bH3Sd7lGvbe+EiCnaoAlTdMsViH3pjVOj9oD+zTS9KF 4iNNeg/m/z7qMW8cpFfd1sOktUpxKln7dPZSLhQ4bBaeL931E9xSGeTtoCeYvRLmX6Q7 TswZ1RgJHZ45jUso5YixH7xubgADa5TkPjbQE74+VjGnXMyipxHBdVx2HhafBZVlB3D0 812Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:references:cc:to:from:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id; bh=Xj5wlhmQXVKQxs1IIfdA5SJW9xmKcaBtJg2SbwjMdN0=; fh=YrEURh7gYKsHMRq69/kC785jAx7LHjA4L8EhvSmxXL8=; b=Aty5K5dHNYJpvyrUM9mm5mbbh6pVtfWwLHlhb4JBykUAvxsD8ARSwAN+xqCx/c+o56 L/T6pWTNUEu2+eU9/MQjrzb7MG8KY+RuOjUoMigljQ4bwyli+ILOFdhj4ToByR7JRUtc JzN+zko09H3dUcjQ/tfd2srioHF2YUXySKa7vwgXSeomKIOCOpT6Kbt+66pMMgE+55Lg K3yXb01K36hoDyiMm30rrF9QuTdl3JPCj5sjGfaUULhMdTG91QhRLTmftRoM34RwJh93 N5ppYtLajiW1GOkb2Lg86YU9Rnl6qqcI1+2PvO6LzvDuxvgU/ut3DyF+9w2YtWDP9D5O MTKA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-39552-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39552-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t15-20020a50ab4f000000b0055c8f2a85d0si148820edc.513.2024.01.25.18.49.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 18:49:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39552-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-39552-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39552-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2EB891F22606 for ; Fri, 26 Jan 2024 02:49:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F300C9463; Fri, 26 Jan 2024 02:49:49 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D911B8F45 for ; Fri, 26 Jan 2024 02:49:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706237389; cv=none; b=NJS6dJd1tMMajTuQdNzv/aPoNSyj03oR6VdG6SYN2DKL6iflrzR3eaadAhl8gnUqe4mOnGx3/oZh0yIo2PtWSaphSLqghs4v5YtCCplaZ8vAHI/d+vxOZg5T8XfalXeHoYBthY1RGn8oovWu/FwZDspkxRqNqnr5jXYeyYXvb8o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706237389; c=relaxed/simple; bh=Bs/eMtfZNuJUb/6D00nv0xPSiBetdR2DPhJ0aIVoNJs=; h=Message-ID:Date:MIME-Version:Subject:From:To:CC:References: In-Reply-To:Content-Type; b=Gf25ZPoFJnjL7OP66zb7Xdk/EIxQD+Sv0RnlY1URDjDv6wbx1MjJt7Dk/RFkHKGNJyfaL7ad/NBrpxJT8QaNivUmN4+k1jmFcVAaq5UR/I3N3AwcZq5hP+zEshFEewv8So3MkuWqvMJun9NuZU/EWeAEVNqOJSfrtPH5MCzNGlE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4TLhvZ2D9mzvTqW; Fri, 26 Jan 2024 10:48:10 +0800 (CST) Received: from dggpemm500020.china.huawei.com (unknown [7.185.36.49]) by mail.maildlp.com (Postfix) with ESMTPS id 5634E18007A; Fri, 26 Jan 2024 10:49:44 +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; Fri, 26 Jan 2024 10:49:43 +0800 Message-ID: Date: Fri, 26 Jan 2024 10:49:43 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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> <9f954701-62e0-4815-8e28-3ed75be07337@huawei.com> In-Reply-To: <9f954701-62e0-4815-8e28-3ed75be07337@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500020.china.huawei.com (7.185.36.49) friendly ping 在 2023/11/30 10:49, Zizhi Wo 写道: > 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 {                                    \