Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp10103461rwb; Fri, 25 Nov 2022 00:44:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf6qd3MAwerC2kBIWJUysD4eXzc30w9mSMZv630Lww9Nu5WG8TNoyS2gQOUnUZJ69+cmS+J7 X-Received: by 2002:a63:cc15:0:b0:476:ccde:6694 with SMTP id x21-20020a63cc15000000b00476ccde6694mr14457544pgf.603.1669365852355; Fri, 25 Nov 2022 00:44:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669365852; cv=none; d=google.com; s=arc-20160816; b=YNMCa+XhXnqZPDMfqwrAfVRu9O1OEMdD7JoNvsL3wzf7XFTu8YrzeoNdvzTV+AFP4M B0DprsJmFwTa2TdnPVF0zV2kxmYImepej2cpHJK0mlu+oUVlfhVJJ51rzlhaAVpNIB5w 7xOdkUEWrsTHaTxoEBV5d1SQUrnuCbE3csTLuQsmTAmM5H+4iszbscyxbdCBbb+fS2cU cJnO0EDtqL+5Np2oec6fBBh0iXVB/ZHWDyLFPYIrZyHBzYwbx8ySpAS6pZH9KODDnvfK N8C1xyQTpGJSTuTv4ttdcK/YI0mTM8hgCf5SOlAyTT4h2eUnfLj1s+WyfwWml+PASg03 rXfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=+PbH8fiotIGZGHgMAjU3iIlzMSQrcs9GTl5/46xgYHg=; b=G0WTGdwivpO1p0rHSdxGggBe206v6cj5YNfMG0yWEZAGXTSl/J4WXGnaTpaFg76Nn7 Uvp8L9+QPTghIQ4ArM1lcTktZgYhtLgbbQg6wL7YcF6DAx5CjBd9JSc3+iFG+kjLhZdq BsUtiDFCdTPoujN9L/KbkRI0+DOzmGYgzNxMyBCqAlyQV3oiqJED5tjUymTDapCRvt4M tp6r2E0V3CyNTweBNpmmPvR3rVt43uigu5b9hzbD1aBFXIwbulom3pa2s2tB9/0Nb1w2 3YK1PFlWr4QG7eeUuwEVSlwOZjcqrbwmEOwfwRnfadhjW3muKowgZG4h8HCc/gBBYdFJ fP3Q== 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 i62-20020a638741000000b00477cb5a71casi3578005pge.36.2022.11.25.00.44.01; Fri, 25 Nov 2022 00:44:12 -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 S229754AbiKYIdV (ORCPT + 86 others); Fri, 25 Nov 2022 03:33:21 -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 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 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