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 DE2AFC4167D for ; Fri, 25 Nov 2022 08:33:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229762AbiKYIdW (ORCPT ); Fri, 25 Nov 2022 03:33:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbiKYIdU (ORCPT ); Fri, 25 Nov 2022 03:33:20 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCF0B2D77C; Fri, 25 Nov 2022 00:33:18 -0800 (PST) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NJSmB5gZGzmVpr; Fri, 25 Nov 2022 16:32:42 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 25 Nov 2022 16:33:16 +0800 Received: from [10.174.178.55] (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 25 Nov 2022 16:33:16 +0800 Subject: Re: [PATCH v2 0/2] fs: clear a UBSAN shift-out-of-bounds warning To: Al Viro CC: Eric Biggers , , "Chris Mason" , Josef Bacik , David Sterba , , References: <20221121024418.1800-1-thunder.leizhen@huawei.com> From: "Leizhen (ThunderTown)" Message-ID: <6660724c-46e8-87b7-e382-51789953242d@huawei.com> Date: Fri, 25 Nov 2022 16:33:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/11/25 14:43, Al Viro wrote: > On Mon, Nov 21, 2022 at 10:44:16AM +0800, Zhen Lei wrote: >> v1 -- > v2: >> 1. Replace INT_LIMIT(loff_t) with OFFSET_MAX in btrfs. >> 2. Replace INT_LIMIT() with type_max(). > > Looks fine, except that I'd rather go for commit message > along the lines of "INT_LIMIT tries to do what type_max does, > except that type_max doesn't rely upon undefined behaviour; > might as well use type_max() instead" Very good. Do I send v3, or do you update it? > > If you want to credit UBSAN - sure, no problem, just don't > clutter the commit message with that. As it is, it reads > as "make $TOOL STFU"... Okay, I'll pay attention next time. This USBAN problem is relatively simple and can be located without relying on other information, so I omitted the rest. After changing to your suggested description, it seems that there is no need to mention UBSAN, after all, it is just a false positive and there is no real problem. > > . > -- Regards, Zhen Lei