Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3979217rwb; Mon, 21 Nov 2022 02:06:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf6hhEIWSUzsU0FkZh8PXsdGrYLrzEBibwthglp+0i8OFzxLxEn/HFz61KjiEUniEGQyy/Iv X-Received: by 2002:a17:907:378:b0:7ad:db82:d071 with SMTP id rs24-20020a170907037800b007addb82d071mr15310782ejb.200.1669025180900; Mon, 21 Nov 2022 02:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669025180; cv=none; d=google.com; s=arc-20160816; b=LF/1tNys8OqmX+4t1txPVT199NvHTp/amiicw7eZPXhruPnexdSb+JkpgE2uKVfrk4 de8dLu/VzKl0xtjOtSjqdi7+zZZnjpSZjSOna63BH4AwAoNR2Q4zHfxhLnp+oFSPkl29 EYXjBhn8R28eLkJf6Lr7iKgzjmhhb55kz4lAjdz9YL/M5Qpk2+1usoGe/CV5dT63+Lfv uR8wO3NTjzbm+9a2VcgJdFHqxAvTcdvIm1WQfCEmcFEI0zaZ8dZWEXCRj+uTl7ETxppH diuSXcEeVra6hu/MxIl7j1ocQXYzxvTBQsZAvLpEmKnfiZ97SSIjuL13Yamcbm2WVU4n LATg== 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:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=TAb5Xf92KFdFIy2FnMFYqVBIQyoF3ynZHvgDZhr/QRk=; b=G2YAZd8QpuFPi/0DXMJ0RsJqElukGaFlLKJKTRO7j3pCQkPy04POLd0U1ILozd2pWa dETOOZCaX+zJ41Qdi9sKExwCChUIowt918OJH+61APqYbLh9TROTAQoB/s3PF5Yke6KZ yrxVm/xfOpJT0KFHw6NikDgYPyCV8d+8k3Gy8RIIQ2EAcvqWtBd52K29lorkE7lsdThC JBrD4y3oC80Sscm28OiN51RDtkJkSvUYVCcqLHYMQyd0N84nD1EFOajLkN+7Yqlsw+Cg 6jFWZvgEoHa5SqDCnLW/ggP0gWmLQyeRqGJYl2DLdiHJyC4qXMv0oejAgOim/31ev4Zn F/qw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a170906974a00b0078d49f0df9csi9265482ejy.453.2022.11.21.02.05.56; Mon, 21 Nov 2022 02:06: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 S230233AbiKUJcS (ORCPT + 91 others); Mon, 21 Nov 2022 04:32:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbiKUJcP (ORCPT ); Mon, 21 Nov 2022 04:32:15 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C19CE8FB2C for ; Mon, 21 Nov 2022 01:32:13 -0800 (PST) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NG2G72bZhzmW4n; Mon, 21 Nov 2022 17:31:43 +0800 (CST) Received: from [10.67.109.51] (10.67.109.51) 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 17:32:12 +0800 Message-ID: <902bb40e-3eb8-cee6-cd6e-849d2fd87f15@huawei.com> Date: Mon, 21 Nov 2022 17:32:11 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH] ubifs: Fix build errors as symbol undefined To: Richard Weinberger CC: Sascha Hauer , linux-mtd , linux-kernel , Wei Yongjun , yusongping References: <20221115083335.21211-1-hucool.lihua@huawei.com> <23feff35-6f2d-5cd7-57f9-ff2591a3c74e@huawei.com> <433070166.256175.1668893150374.JavaMail.zimbra@nod.at> <540631712.260900.1669017601995.JavaMail.zimbra@nod.at> From: "Lihua (lihua, ran)" In-Reply-To: <540631712.260900.1669017601995.JavaMail.zimbra@nod.at> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.109.51] 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,NICE_REPLY_A, 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: X-Mailing-List: linux-kernel@vger.kernel.org Follow your suggestion, I will push a new patch,Thanks. 在 2022/11/21 16:00, Richard Weinberger 写道: > ----- 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 > > . >