Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3875465rwb; Mon, 21 Nov 2022 00:10:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf7dn0ufUKcjZzY2Ia2+R/hRt56qfGERttDSyPyBJtQ7xZkjBIsYji0BEexXzZbuFEdV012w X-Received: by 2002:a17:902:8347:b0:188:f570:7bb6 with SMTP id z7-20020a170902834700b00188f5707bb6mr10872246pln.74.1669018250146; Mon, 21 Nov 2022 00:10:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669018250; cv=none; d=google.com; s=arc-20160816; b=H8A6qp1OOPpQduT1KgFClhnU+qn5eppoWwOR5WVG0+k1v3FGbV2j0O0XqUy13kiicn UuOju8oe52YEaR2E5h7KxwAtch7NSdj3YpoydroDI8zkKhneLu2vRwqw5cY8GHNuDdRd 7Ok0QQ53/EWam/dlsPEBZ1yJgoOTkp0c5xTCOMhLIJ6+tugXJ5smCWklADrnGy72+eXn FczNLx84JRgWStlKuiwusJS75o5bMBbFrqkVKv63vni4XtYGodZsJfPPhUYypPjEYZzp XQ9ZTmHUa8YA3X9S4/o413Km6kidwemaoFb/4bssSRv1sRpNL4NatrK/HXR3az9GbREl zFGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=E6h82SU0vWUiMqsEmMdSrXvHS8xRvQ6vyfqwYtahq8k=; b=GiRiFs9/4a8irCNer0O+w1p1It6Ti+ztJOLNqHmr9eTgNYXsEhsLaWz/Lj9LJV2Xve UvIgfIEBnoEmM3OgLjHamxQTtNHD7/KekDCEYnj9IWsUuQZYwvA8c5P9+HbzlHzy6EIo zFp875oRoIIuB7+PSbQtd600d8ATotTbGBehhcQUudoTf10dlkKFwE3SfwnBKUgaiazG HkSzhCJzhBlOuoKuWjWsWiEufyyzsLXQGdG6NBnP+UHzuqyoPGVumCfQpSjpYjwKbhmh EiorYBhir7upXk79y1pl7Jsa14M7Rg9kUNJw+pRWixP79A5eYtfd1lHnCsjy51V5879k mopA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a656388000000b0046fd9ddc689si10745267pgv.571.2022.11.21.00.10.36; Mon, 21 Nov 2022 00:10:50 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229921AbiKUIAM convert rfc822-to-8bit (ORCPT + 91 others); Mon, 21 Nov 2022 03:00:12 -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== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, T_SPF_PERMERROR 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 ----- 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