Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4948564rwl; Mon, 10 Apr 2023 20:46:42 -0700 (PDT) X-Google-Smtp-Source: AKy350Z+Ebtljr7gTQz2GUcQB3t38ZCMQrTYgdxNtVLeBBD1rX5J/ItRd2mwo3eCULB/aEEXt6WL X-Received: by 2002:a17:907:7758:b0:94a:4e70:ae35 with SMTP id kx24-20020a170907775800b0094a4e70ae35mr7365909ejc.31.1681184801729; Mon, 10 Apr 2023 20:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681184801; cv=none; d=google.com; s=arc-20160816; b=UbWWF8k4GH23r0qvbvraFO4JPgZmocskJwromoMX66jMcKP3G49UHNBJW3Cis1Xe/g UgPNa7KHx4zZZTygM21+4+gr5HMpK/vVgGPzPUkMbH+81sSMcFUIfr+z7EUZ2d6wIhXK yCaSV0rIMq8R3cszeaJnbAMwnixg3nZNhLmF/jz6KP6wIq2x0Sc+BRUeCwjMqQdoH1K1 kukGyNy6FSvA/B5froqTfxAQ9S/NH1x99sjmBkFg37/ZCbc8SOxujny/JTLgvhHWGmAw Rscx56Zpmd4AoLYZJ/e2wcCRrhdNRDg2Sv48C/fZ9xzG7ea1vS38dJj9TiMNAH2QkVHD E89A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=23J/8FBsXEnL7p9k8s46zYOwMEms6Ik/i/msTFqEsPs=; b=Cs2+6fjyAXWMyx+yCJMYZ6t2/SZkTpAtMuKv0zi8qzYFT+9a3KPWo350eM/efyfeyo eCFH9j/PVghMIqc0JfscNJnnLaPCVOA4isww7102tw+6sBZGKzyMownq+L3ANgCpLHZv 77K7pFx9kdDOUVBAR0I00AvAY6gIBjAkX2XzYwz5SX+KciqBgUMUK2WvDElJ0smLglfU xG/deHcLnSZl5vSW0aypjcvjg1orkOx5amL/DgleL/VIyxo6q6ujmXqo+Imy+EqE8Qe7 91s68NkbG6i7cnxGsZFGUlI/VozlwutM2P7FejK10gWcp14JIAl4OeFiTZKfw8M8+asX yWSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=OzpBgaZC; 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 la20-20020a170907781400b0093ae5807239si10241019ejc.71.2023.04.10.20.46.15; Mon, 10 Apr 2023 20:46:41 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=OzpBgaZC; 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 S230122AbjDKDof (ORCPT + 99 others); Mon, 10 Apr 2023 23:44:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbjDKDoB (ORCPT ); Mon, 10 Apr 2023 23:44:01 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B44E40D4; Mon, 10 Apr 2023 20:42:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=23J/8FBsXEnL7p9k8s46zYOwMEms6Ik/i/msTFqEsPs=; b=OzpBgaZCyER1AUJcKzgA2bSBav P6xljmei5C48FtZNQb2a5cp9EO7ZrGqw/3KfVMrKFGd7m8Wv1ZnXQelKkGEdu9uqjdpXC8D4kcOvu AJRXSSVQcCuCReDfBKapzg1PANTFvST7ydHdAz2+QfBl2G9mt2/GHtJSeLE75/seGBea+1zl4OO7q 1XnS7WOIMhWbl7c2Kp+K9REG1FOouV+6WqYCjri7FRhw7MP5Ij64rbS/JghVLovA8HgnkgCKENkXL vRjaoSxG+LbSqJkiqVFZvdHP9JIJeQrRyfDJZ75bS9+Azc2NcaaW0Soexe5re6GRZdudOPT+oX3wy VaJx2qCQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pm4tX-005HBj-Uy; Tue, 11 Apr 2023 03:42:12 +0000 Date: Tue, 11 Apr 2023 04:42:11 +0100 From: Matthew Wilcox To: Andrew Morton Cc: Peng Zhang , Liam.Howlett@oracle.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org, David Binderman , stable@vger.kernel.org Subject: Re: [PATCH v2] maple_tree: Use correct variable type in sizeof Message-ID: References: <20230411023513.15227-1-zhangpeng.00@bytedance.com> <20230410202935.d1abf62f386eefb1efa36ce4@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230410202935.d1abf62f386eefb1efa36ce4@linux-foundation.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 Mon, Apr 10, 2023 at 08:29:35PM -0700, Andrew Morton wrote: > On Tue, 11 Apr 2023 10:35:13 +0800 Peng Zhang wrote: > > > The type of variable pointed to by pivs is unsigned long, but the type > > used in sizeof is a pointer type. Change it to unsigned long. > > Thanks, but there's nothing in this changelog which explains why a > -stable backport is being proposed. When fixing a bug, please always > describe the user-visible effects of that bug. There is no user-visible effect of this bug as the assembly code generated will be identical. > > --- a/lib/maple_tree.c > > +++ b/lib/maple_tree.c > > @@ -3255,7 +3255,7 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end > > > > if (tmp < max_p) > > memset(pivs + tmp, 0, > > - sizeof(unsigned long *) * (max_p - tmp)); > > + sizeof(unsigned long) * (max_p - tmp)); > > > > if (tmp < mt_slots[mt]) > > memset(slots + tmp, 0, sizeof(void *) * (max_s - tmp)); > > Is there any situation in which > sizeof(unsigned long *) != sizeof(unsigned long)? Windows 64-bit (pointer 64-bit, unsigned long is 32 bit) is the only one I know. Linux is all ILP32 or LP64. There may be some embedded environments which are different, but I have no idea what they might be.