Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1186380iob; Thu, 19 May 2022 00:52:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5Nl10Q3slHOLwGdjhEBqk5p5ishjMV7EJ9KqZ7XhfBKM/ZJEnj1gNpqF7T5bZZu62T9iB X-Received: by 2002:a05:6a00:4091:b0:510:71b1:963e with SMTP id bw17-20020a056a00409100b0051071b1963emr3641681pfb.31.1652946725452; Thu, 19 May 2022 00:52:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652946725; cv=none; d=google.com; s=arc-20160816; b=DU8Kodn3u4YGDCblLhfXLBBa1ZL8VkMgAow3zHWmE1dKIAKQY1DtobsszHDHsRy8vL gEZS40O0cCISXYRr9uZ0LPksu9WZuCFjKR8Xdyjq0XK9G773VU5uDwZACgvY8mOuyK3v 0iKm8llQ7lmIJ57a6DmM7t34efQncT85lkon7YnORGppJEM5x+JEfmSG7evdWWNNbUC4 tb0z9fhPfDW6vuZyF8+UfygEdXqpHWd6+dlPywHVf7RTiGByAre0z5PMG9ABWuih/dfd WR8IC+PIJYChRHLqnAXj1bfvVJhfSFFp+5wbMgWx3ZowTNYIVocyLyyrOJD+RMNSYNDM Zxqg== 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=28F30VxVQChNKCP+Gm82tukcjqoIfRDkE5E07PO9SBg=; b=M5FoLpHwmdPGnwA+hUzSC4vjBBhR5W4cZPYNq+xvOe+5WAxcvb/L5i/jfkaBedNGls Q/iiVA3UPtVoRkKaRMuoFu8BFe6RN3y6ri5JdTx7+ZNUqw6dg+HEqkid+tRhhNrJBTE4 L2S3gAPHFiwa+W0KYJcbRfhAXl57Mo6b4oLU+kONDgeeHnyuI68I7EyZuEuA/Dq4p/h8 gTHt9oAoNYEN5B+/T8p3LuxHetI3l7qKwiIzKBE26ev9ewsOpzxD3KkvbW45lwmyeDR6 B7zDLMsQ2Dco3s1x3XbLEYlIZveHLQeJOCOdCy+bRrhJE5wAt/9rt3nP4DTnBrcHR/4k 5vrw== 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 m124-20020a633f82000000b003db48a0c6ecsi5344440pga.792.2022.05.19.00.51.46; Thu, 19 May 2022 00:52:05 -0700 (PDT) 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 S234310AbiESGWt (ORCPT + 99 others); Thu, 19 May 2022 02:22:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229654AbiESGWq (ORCPT ); Thu, 19 May 2022 02:22:46 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EB0F2719; Wed, 18 May 2022 23:22:44 -0700 (PDT) Received: from canpemm500005.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L3frH6TCfz1JCPG; Thu, 19 May 2022 14:21:19 +0800 (CST) Received: from [10.67.110.73] (10.67.110.73) by canpemm500005.china.huawei.com (7.192.104.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 19 May 2022 14:22:42 +0800 Message-ID: <6ef6905f-563d-2361-36fb-d6f56a5d6353@huawei.com> Date: Thu, 19 May 2022 14:22:41 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH -next v2] fs-verity: Use struct_size() helper in enable_verity() To: Eric Biggers CC: , , References: <20220519022450.2434483-1-chris.zjh@huawei.com> From: "zhangjianhua (E)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.110.73] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500005.china.huawei.com (7.192.104.229) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Thanks, I will do more work about sparse and maybe find some answers. Zhang Jianhua 在 2022/5/19 12:22, Eric Biggers 写道: > [Please use reply all, not just reply!] > > On Thu, May 19, 2022 at 11:54:48AM +0800, zhangjianhua (E) wrote: >> Hi Eric >> >> The warnings in commit message are from the build log in Jan 2022, and I >> find these sizeof are still here, so I submit >> >> these two patches. I build the kernel just now and encounter the same >> situation with you, there are lots of warnings. >> >> Maybe you are right, there should be some mechanism to solve this problem >> completely. >> >> > I've updated the commit message and applied this patch, but not the other one, > as the other one wasn't actually dealing with a variable length which made it > pretty much pointless, as I mentioned. > > If you'd like to look into making sparse enable this warning by default, I'd > certainly encourage you to do so. But it looks like the warning itself could > use some more work. It probably should only warn if the > sizeof(struct_with_flexible_array) is actually being added to another value, and > where that value is not a compile-time constant. > > - Eric > .