Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5136929rwd; Tue, 23 May 2023 19:12:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6pB/JNszxGDHyIhccG5ua18HgQZJS0CCA8WuvEXMq4HtJAzzHGfNEpGjQRwwvdt97bOP54 X-Received: by 2002:aa7:8896:0:b0:64c:ae1c:337f with SMTP id z22-20020aa78896000000b0064cae1c337fmr1356605pfe.12.1684894347666; Tue, 23 May 2023 19:12:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684894347; cv=none; d=google.com; s=arc-20160816; b=Tq58TG53Wet7HaipFU09MWxP98VRB6P7pD8XDbpKG802c5qQseccdna468Wbe6JJUP blgcuCHG4Tq7/Ig3pz3XUnOPSEZiko8Zvg6dZqhdzatMVJy5bfrLFeOyhoOTY90R+s3y K7j68FHt4utlb87FeBOfsxcGlENwmqeY3SwDLM2IDNEPWJ3ddP/ZnlVt2fPq+ggw1hNU xbj+V+o0tIOFJwAYDM0WqG8wnTTXZ5zXgaroIasxsgJjJOR+LdVEAFmmlCiQ36IzSx4T plXNZi6FRESS1lO2wlKfY7yHbVkiWem3S4jOyYyxU00231wqSNAoL9i7eokDSSe5llow aQyQ== 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=n5Oa9MiauHu7AScrPKWzHE9Q5wIC8ZpuckL10uXHkOk=; b=i73gQJ1ULxrp1d8k5kLtikd2RodSRbxIGb4eTeYISG5vW+4JMQ3J7wwZm+Raht5o12 OS4RbP1vxPMyPTzdLW+B+sar8UYuOtfq/vluT/yhZiTb1EdaX3Z76OipZ1082xPlvWdz 5lrXcJiXBMc+dLRiOWI88IdTmDkA2O3niM8fzbISDbe8AUUUl4+84Iu3NyuJyKWI5Kit M4jZX3eW3tuqpBucqXD5PFZkBo+b6JSZDK9qvKQ1FNr68JBpjPRJONhNzv62tgE5R7ma tnuOZCpFubdAi9DbwYRq7+sw9ZIGBLszIakbWEYaGxevA3yHNYRnW3sTgEkW6LxcBrjf tYEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VgKFPbZO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g11-20020a63374b000000b005307b843a98si1124239pgn.53.2023.05.23.19.12.13; Tue, 23 May 2023 19:12:27 -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=@kernel.org header.s=k20201202 header.b=VgKFPbZO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239016AbjEXBgc (ORCPT + 99 others); Tue, 23 May 2023 21:36:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232881AbjEXBga (ORCPT ); Tue, 23 May 2023 21:36:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C714135 for ; Tue, 23 May 2023 18:36:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2611E6359D for ; Wed, 24 May 2023 01:36:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D0FCC433D2; Wed, 24 May 2023 01:36:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684892187; bh=I2ozqFvCTggoEgIg06Ztdcvnq1LV8wq5Ff07A01+XXw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VgKFPbZOWSAEz+494/nPXUSZu8CWsD1wHOF+o2vQqQae6t+T6eSxLqJ9iF9KtWIXu DY1fHY0JMKQp9Jh8SQysGCpacoQZucwVjJ6RwSNDz/yUf4iyJzO6/5RoZ3iW4DjD1B XpsLKZu9LKoUqI4FoQvEn+Avs/JeA5hLfSrA1O2Ui/v+Gi4JH9b6BeCFJlHARxX8ru /iBV2FdlrdPp71PZQ79e2gimzwctJ9+q+BfCKsR07739oYLe7HkMgrFKeuwV+ZEFow VTqjmpwipNocDjLRqbCcnfrfUNqTlsoDXRp3Qjvubfv8SU8bO0ENoyBh9MeOwbOt49 x2tnlnV/R7n3w== Date: Tue, 23 May 2023 18:36:25 -0700 From: Jaegeuk Kim To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] f2fs: fix to use le32_to_cpu() in RAW_IS_INODE() Message-ID: References: <20230518092931.2280835-1-chao@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230518092931.2280835-1-chao@kernel.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On 05/18, Chao Yu wrote: > __le32 type variable should be converted w/ le32_to_cpu() before access. > > Signed-off-by: Chao Yu > --- > fs/f2fs/f2fs.h | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > index 7f6c51a6b930..a4bff3b5b887 100644 > --- a/fs/f2fs/f2fs.h > +++ b/fs/f2fs/f2fs.h > @@ -2840,7 +2840,11 @@ static inline void f2fs_radix_tree_insert(struct radix_tree_root *root, > cond_resched(); > } > > -#define RAW_IS_INODE(p) ((p)->footer.nid == (p)->footer.ino) Does this compare the same __le32 types? > +static inline bool RAW_IS_INODE(struct f2fs_node *node) > +{ > + return le32_to_cpu(node->footer.ino) == > + le32_to_cpu(node->footer.nid); > +} > > static inline bool IS_INODE(struct page *page) > { > -- > 2.40.1