From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36173C433FE for ; Mon, 21 Nov 2022 08:00:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229878AbiKUIAN convert rfc822-to-8bit (ORCPT ); Mon, 21 Nov 2022 03:00:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229590AbiKUIAI (ORCPT ); Mon, 21 Nov 2022 03:00:08 -0500 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A3511DA41 for ; Mon, 21 Nov 2022 00:00:05 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id B4C0E63E516C; Mon, 21 Nov 2022 09:00:03 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id wqfkx6HDd9gD; Mon, 21 Nov 2022 09:00:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id A4A9263E514E; Mon, 21 Nov 2022 09:00:02 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id OwGoWtZDMXHC; Mon, 21 Nov 2022 09:00:02 +0100 (CET) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 64E6463E5146; Mon, 21 Nov 2022 09:00:02 +0100 (CET) Date: Mon, 21 Nov 2022 09:00:02 +0100 (CET) From: Richard Weinberger To: Lihua Cc: Sascha Hauer , linux-mtd , linux-kernel , Wei Yongjun , yusongping Message-ID: <540631712.260900.1669017601995.JavaMail.zimbra@nod.at> In-Reply-To: References: <20221115083335.21211-1-hucool.lihua@huawei.com> <23feff35-6f2d-5cd7-57f9-ff2591a3c74e@huawei.com> <433070166.256175.1668893150374.JavaMail.zimbra@nod.at> Subject: Re: [PATCH] ubifs: Fix build errors as symbol undefined MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF97 (Linux)/8.8.12_GA_3809) Thread-Topic: ubifs: Fix build errors as symbol undefined Thread-Index: 6puvwghxBPcdUYfcEut9ULq3gVbn3A== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- Ursprüngliche Mail ----- > Von: "Lihua" > An: "richard" > CC: "Sascha Hauer" , "linux-mtd" , "linux-kernel" > , "Wei Yongjun" , "yusongping" > Gesendet: Montag, 21. November 2022 02:54:53 > Betreff: Re: [PATCH] ubifs: Fix build errors as symbol undefined > You can verify it with the config in the attachment. TKS :D Thanks for your .config, I was able to identify the problem. When CONFIG_CC_OPTIMIZE_FOR_SIZE is set the compiler does not optimize this construct: err = ubifs_node_check_hash(c, buf, zbr->hash); if (err) { ubifs_bad_hash(c, buf, zbr->hash, lnum, offs); return 0; } 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 we need a no-op ubifs_bad_hash() for the CONFIG_UBIFS_FS_AUTHENTICATION=n case. Thanks, //richard