Message ID | 20221121111847.71648-1-hucool.lihua@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1507969wrr; Mon, 21 Nov 2022 02:52:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf6fBZwhfYA9ZansCPk+Aq8WABhG1iU3yMYRIvMm20r+mBkCMEfIL8oh0XE98Hmi5vAcsYH5 X-Received: by 2002:aa7:c844:0:b0:461:a130:ea3c with SMTP id g4-20020aa7c844000000b00461a130ea3cmr15224221edt.272.1669027940388; Mon, 21 Nov 2022 02:52:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669027940; cv=none; d=google.com; s=arc-20160816; b=oNEZb5fd0IgsqXRS4otVfbR7x8Jnlgp1o4enoF0PwL/vM3W1g1iZEqlcz+vZ4YNm+F vdWwaS0Wo9/lOL5VuqKq9r0VpiUpn5SxpHkEktvpmAT+LrsMGe6z284OnlEYVDSEWnMD mQ1mBXYHQsTJc6ZJMdzDWKTF/LbRpPy1siRqkBEl8TVG82EzMh2ptqxCHlEPOi9U9jIq /HzHFtBkc9PXjx9FEvrZduRE2anRVuD2eJ9OCvCrkk2ik5DDtCuIY/l83ONO419b9WBM 2HLnBpsUKcNJz2lrERexBiLhqOv5BP/Z48n+62UA3XexfZSsl3YqjjnYOAc4yRIyIYL8 nO0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=ddXyxdKKiujzxqQ6CPzcYbP9LHWzcPUPPLg7/S3e21w=; b=hIU7DKc+isekaBHoTuoykP08HA3t7Yzirty+dnloXrz+T53YYlQcbHA8cK6l8gzDFe Bz7yfKghbs5vqPmaTMLQKYgJhsDCSov6/9cxOwkqKaatwCfcV+7PHUv6teH2XPSgRe58 W2tXEcZETHNwGOaqC0IUA2AvDREgtGNkhYSJYrdUrTsq6u+PffGAlVldqGvxjljs8pSc H4zoIi54L7a8nMIxxKyldhoBMQX5wY9uE93LZxVRHd6wDnB0yornfSf28TE6uYYsvlQg COXecQdGOJ5Te0sGvUoE0ZGtr6sgJ6/YHOMJh85Pwr5jl8RvkyWiXgUELyO3KG9UinIu sy+Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht20-20020a170907609400b00782035a06b4si9888959ejc.200.2022.11.21.02.51.56; Mon, 21 Nov 2022 02:52:20 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229674AbiKUKuI (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Mon, 21 Nov 2022 05:50:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbiKUKuG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 21 Nov 2022 05:50:06 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD064B84A for <linux-kernel@vger.kernel.org>; Mon, 21 Nov 2022 02:50:04 -0800 (PST) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NG3w15Qf4zqSb3; Mon, 21 Nov 2022 18:46:09 +0800 (CST) Received: from huawei.com (10.67.174.191) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 21 Nov 2022 18:50:02 +0800 From: Li Hua <hucool.lihua@huawei.com> To: <richard@nod.at>, <s.hauer@pengutronix.de> CC: <linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <weiyongjun1@huawei.com>, <yusongping@huawei.com>, <hucool.lihua@huawei.com> Subject: [PATCH v2] ubifs: Fix build errors as symbol undefined Date: Mon, 21 Nov 2022 19:18:47 +0800 Message-ID: <20221121111847.71648-1-hucool.lihua@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.174.191] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749548624420790575?= X-GMAIL-MSGID: =?utf-8?q?1750102641654595519?= |
Series |
[v2] ubifs: Fix build errors as symbol undefined
|
|
Commit Message
Lihua (lihua, ran)
Nov. 21, 2022, 11:18 a.m. UTC
With CONFIG_UBIFS_FS_AUTHENTICATION not set, the compiler can assume that
ubifs_node_check_hash() is never true and drops the call to ubifs_bad_hash().
Is CONFIG_CC_OPTIMIZE_FOR_SIZE enabled this optimization does not happen anymore.
So When CONFIG_UBIFS_FS and CONFIG_CC_OPTIMIZE_FOR_SIZE is enabled but
CONFIG_UBIFS_FS_AUTHENTICATION is not set, the build errors is as followd:
ERROR: modpost: "ubifs_bad_hash" [fs/ubifs/ubifs.ko] undefined!
Fix it by add no-op ubifs_bad_hash() for the CONFIG_UBIFS_FS_AUTHENTICATION=n case.
Fixes: 16a26b20d2af ("ubifs: authentication: Add hashes to index nodes")
Signed-off-by: Li Hua <hucool.lihua@huawei.com>
---
fs/ubifs/ubifs.h | 5 +++++
1 file changed, 5 insertions(+)
Comments
ping 在 2022/11/21 19:18, Li Hua 写道: > With CONFIG_UBIFS_FS_AUTHENTICATION not set, the compiler can assume that > ubifs_node_check_hash() is never true and drops the call to ubifs_bad_hash(). > Is CONFIG_CC_OPTIMIZE_FOR_SIZE enabled this optimization does not happen anymore. > > So When CONFIG_UBIFS_FS and CONFIG_CC_OPTIMIZE_FOR_SIZE is enabled but > CONFIG_UBIFS_FS_AUTHENTICATION is not set, the build errors is as followd: > ERROR: modpost: "ubifs_bad_hash" [fs/ubifs/ubifs.ko] undefined! > > Fix it by add no-op ubifs_bad_hash() for the CONFIG_UBIFS_FS_AUTHENTICATION=n case. > > Fixes: 16a26b20d2af ("ubifs: authentication: Add hashes to index nodes") > Signed-off-by: Li Hua <hucool.lihua@huawei.com> > --- > fs/ubifs/ubifs.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h > index 478bbbb5382f..2f1f31581094 100644 > --- a/fs/ubifs/ubifs.h > +++ b/fs/ubifs/ubifs.h > @@ -1623,8 +1623,13 @@ static inline int ubifs_check_hmac(const struct ubifs_info *c, > return crypto_memneq(expected, got, c->hmac_desc_len); > } > > +#ifdef CONFIG_UBIFS_FS_AUTHENTICATION > void ubifs_bad_hash(const struct ubifs_info *c, const void *node, > const u8 *hash, int lnum, int offs); > +#else > +static inline void ubifs_bad_hash(const struct ubifs_info *c, const void *node, > + const u8 *hash, int lnum, int offs) {}; > +#endif > > int __ubifs_node_check_hash(const struct ubifs_info *c, const void *buf, > const u8 *expected); >
On Mon, Nov 21, 2022 at 07:18:47PM +0800, Li Hua wrote: > With CONFIG_UBIFS_FS_AUTHENTICATION not set, the compiler can assume that > ubifs_node_check_hash() is never true and drops the call to ubifs_bad_hash(). > Is CONFIG_CC_OPTIMIZE_FOR_SIZE enabled this optimization does not happen anymore. > > So When CONFIG_UBIFS_FS and CONFIG_CC_OPTIMIZE_FOR_SIZE is enabled but > CONFIG_UBIFS_FS_AUTHENTICATION is not set, the build errors is as followd: > ERROR: modpost: "ubifs_bad_hash" [fs/ubifs/ubifs.ko] undefined! > > Fix it by add no-op ubifs_bad_hash() for the CONFIG_UBIFS_FS_AUTHENTICATION=n case. > > Fixes: 16a26b20d2af ("ubifs: authentication: Add hashes to index nodes") > Signed-off-by: Li Hua <hucool.lihua@huawei.com> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Sascha > --- > fs/ubifs/ubifs.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h > index 478bbbb5382f..2f1f31581094 100644 > --- a/fs/ubifs/ubifs.h > +++ b/fs/ubifs/ubifs.h > @@ -1623,8 +1623,13 @@ static inline int ubifs_check_hmac(const struct ubifs_info *c, > return crypto_memneq(expected, got, c->hmac_desc_len); > } > > +#ifdef CONFIG_UBIFS_FS_AUTHENTICATION > void ubifs_bad_hash(const struct ubifs_info *c, const void *node, > const u8 *hash, int lnum, int offs); > +#else > +static inline void ubifs_bad_hash(const struct ubifs_info *c, const void *node, > + const u8 *hash, int lnum, int offs) {}; > +#endif > > int __ubifs_node_check_hash(const struct ubifs_info *c, const void *buf, > const u8 *expected); > -- > 2.17.1 > >
----- Ursprüngliche Mail ----- > Von: "Lihua" <hucool.lihua@huawei.com> > An: "richard" <richard@nod.at>, "Sascha Hauer" <s.hauer@pengutronix.de> > CC: "linux-mtd" <linux-mtd@lists.infradead.org>, "linux-kernel" <linux-kernel@vger.kernel.org>, "Wei Yongjun" > <weiyongjun1@huawei.com>, "yusongping" <yusongping@huawei.com> > Gesendet: Mittwoch, 23. November 2022 04:29:04 > Betreff: Re: [PATCH v2] ubifs: Fix build errors as symbol undefined > ping While I'm perfectly fine with pinging, because I'm more busy than I want to, pinging after less than 48 hours is a little aggressive. Thanks, //richard
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 478bbbb5382f..2f1f31581094 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -1623,8 +1623,13 @@ static inline int ubifs_check_hmac(const struct ubifs_info *c, return crypto_memneq(expected, got, c->hmac_desc_len); } +#ifdef CONFIG_UBIFS_FS_AUTHENTICATION void ubifs_bad_hash(const struct ubifs_info *c, const void *node, const u8 *hash, int lnum, int offs); +#else +static inline void ubifs_bad_hash(const struct ubifs_info *c, const void *node, + const u8 *hash, int lnum, int offs) {}; +#endif int __ubifs_node_check_hash(const struct ubifs_info *c, const void *buf, const u8 *expected);