Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5306407rwb; Mon, 14 Nov 2022 02:33:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf5cINBXC2IzlSQl3xrXZjbOxAvhJTzvpAelOIu+E9AY9f9xKY0PJd0woPp77nRHbNiLWgQp X-Received: by 2002:a17:902:f68c:b0:186:9369:bcec with SMTP id l12-20020a170902f68c00b001869369bcecmr12890649plg.131.1668421982509; Mon, 14 Nov 2022 02:33:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668421982; cv=none; d=google.com; s=arc-20160816; b=MYHKpddfZcvKBevDswckxR22WkeKiUmZtu+DHjccvGGCKzsZ4Q/lie/U8Ph6MqGbkf 5Z31bFAqBilM69M3kQRcqY1V1uXVgUXnTV0jAEHbYyxR/NyZNiEE/pFnJGeMDBLCHE9A zy8Amr0sWAhvaI3F9W3KpAKGiDMMP4GVTN215QHLeRdNPh7iQi5XxgHZy02PdwjZA8l5 xS2I8paRcrJPNSkMaL0URNcZUPQWI8WwZDwu3xgI6yRjyNDsDPPNbOsDE0ztv8DPfmNS 4GokLZWv9PD/c8cuXhucB03UDOEO8HN1mq7S1JgXx8wwBQqCllDwF0G52ddHImaHlqGy SsmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=Sqoo4IjMdLl+gwYK44DprelnuA9DnGWY/ANBVWRBeWM=; b=UbcT3Ktiid26QGey8AWXDPcUAemWJqWptGEXgeJf4xQsEu/5oJJ7QXYxauQ8DbdIg/ hrMB16hqbXJ0vsqUhjJCjzEd8VtUB/6UVje5BvbsGeePhw5yMkJBvKhf0lWbGaFoXT0r LUAv5E5ogXkStrz5bAslxiBaZk1NlK/qYLCwgQckSeyPzKiiTtCr6m7pqpb2z6AdZJyK FrNVX0iedan0rHTK68zKoCrN72BcX90ZCJVsUYuSxsV29nlyICe/kXYn+8d5b1xpv3CD LsENQ1CqdlIBmVP0hNoIFiyRB5Z91lG3h6SHQeHHAonxazQbCXNjqLyaNzs7dTBIRsfO w8uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=O4HviMU7; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=FqScHq0u; 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 7-20020a630207000000b0047011874d9fsi9726411pgc.627.2022.11.14.02.32.51; Mon, 14 Nov 2022 02:33:02 -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; dkim=pass header.i=@arndb.de header.s=fm3 header.b=O4HviMU7; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=FqScHq0u; 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 S235643AbiKNKSQ (ORCPT + 88 others); Mon, 14 Nov 2022 05:18:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233548AbiKNKSP (ORCPT ); Mon, 14 Nov 2022 05:18:15 -0500 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FFDADF for ; Mon, 14 Nov 2022 02:18:14 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 5E8CD3200927; Mon, 14 Nov 2022 05:18:11 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Mon, 14 Nov 2022 05:18:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1668421090; x= 1668507490; bh=Sqoo4IjMdLl+gwYK44DprelnuA9DnGWY/ANBVWRBeWM=; b=O 4HviMU7BF8TBeb9tfyMcLULD0aVhJ7koWP772po3dNCAycEcSgGfVlruglHjEzDa 4WGTa404Jt7Cxeg0saCJ1u0O2rWYzJqekU9mj8aObr6JsrWU2vONPI56yoXGxb0p r7wWU7HdyneKkwPXG8CrHJMtDs7qpx977S6ZzL3p2PUgTrTRn4qemzIxZY1l3ZSV v+AtV8Ekj7YQ//H0PO1bmZyeou4LGa5yWTbaA410DudlqpVTcfgGFi3kxgl0NAkL o5T6iqOIH96GwIwZb9M3q4SDa9cyfAD9Yx6OvHT5ufCK7xKSwEyYf0+syzpPPjCc H/LV0jLMI/7GXuuuyMEcw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1668421090; x= 1668507490; bh=Sqoo4IjMdLl+gwYK44DprelnuA9DnGWY/ANBVWRBeWM=; b=F qScHq0ujafwzGkr779E18cB59whIxm5LcmWTz6Q2fBThdEuUkGZnIfQvqPRbv7gY 14UuBRHofadY1DLFaC76caHTIEGpgQQwqzygWMLy5DNzY1xPLjcoE9HwH8UdtPu3 UFovcZn1NVfWBNqAhJcQUth8oTxMFgCerTDWyBYIabyBDvpw8kxdMO1i2SXqyrtb AmHV2LuvOmPZOKH60wSK33+O1WBSiGmtNkXCFoW3H1iLyha+af4dfte0jGbvFmrd 3Wr1nHazxxF+ZOdnQ4gvumABx+y6QhIAI5Jvh2bkOXQz3N317azoN/OBN3o4qcSv bBEiUBgD4Rc8WDTCQFjMA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedugddugeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeegfeejhedvledvffeijeeijeeivddvhfeliedvleevheejleetgedukedt gfejveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 28ACFB60086; Mon, 14 Nov 2022 05:18:10 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: In-Reply-To: References: <1667889638-9106-1-git-send-email-zhiguo.niu@unisoc.com> <202211101659.j9z9jLHv-lkp@intel.com> <88fce16b-5092-4246-8bbf-23f2c03224f3@app.fastmail.com> <97c529f2-c5a2-4ed6-89eb-c79f020e9d0c@app.fastmail.com> Date: Mon, 14 Nov 2022 11:17:48 +0100 From: "Arnd Bergmann" To: "Zhiguo Niu" Cc: "kernel test robot" , "zhiguo.niu" , jaegeuk@kernel.org, chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev Subject: Re: [PATCH V2] f2fs: fix atgc bug on issue in 32bits platform Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 Mon, Nov 14, 2022, at 10:23, Zhiguo Niu wrote: > Arnd Bergmann =E4=BA=8E2022=E5=B9=B411=E6=9C=8811=E6=97= =A5=E5=91=A8=E4=BA=94 17:57=E5=86=99=E9=81=93=EF=BC=9A > so I just modify struct victim_entry as your suggestion: > diff --git a/fs/f2fs/gc.h b/fs/f2fs/gc.h > index 19b956c2d697..e2f25b8fd865 100644 > --- a/fs/f2fs/gc.h > +++ b/fs/f2fs/gc.h > @@ -56,16 +56,16 @@ struct gc_inode_list { > }; >=20 > struct victim_info { > - unsigned long long mtime; /* mtime of section */ > - unsigned int segno; /* section No. */ > + unsigned long long mtime __packed; /* mtime of section */ > + unsigned int segno; /* section No. */ > }; >=20 > struct victim_entry { > struct rb_node rb_node; /* rb node located in rb-tree */ > union { > struct { > - unsigned long long mtime; /* mtime of section */ > - unsigned int segno; /* segment No. */ > + unsigned long long mtime __packed; /* mtime of section */ > + unsigned int segno; /* segment No. */ > }; > struct victim_info vi; /* victim info */ > }; Right, this should work. I'm still unsure where you need a union inside of victim_entry rather than just having the 'victim_info' portion in there by itself, but that is not a matter of correctness. > There is no problem with functional verification in both 64bit and=20 > 32bit platforms,=20 > sorry I don't have the environment to verify is build warnig reported=20 > by the kernel test robot still there. I had a bit trouble reproducing this as well. It looks like this only happens when -Wunaligned-access is enabled for a config, but that requires two things: - building with CC=3Dclang for a target architecture that does not support unaligned access natively, such as ARMv5. ARMv7 is interesting because it disables the warning, though it only supports unaligned load/store on 32-bit and 16-bit words but not 64-bit words using the ldrd/strd instructions. - Even on architectures with no unaligned load/store, the warning is disabled by default unless you use "make W=3D1" to enable extra warnings. Alternatively, you can enable the warning manually by passing "CFLAGS_MODULE=3D-Wunaligned-access" to make, which should trigger the warning on any 32-bit architecture. Arnd