Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp693078rwd; Thu, 18 May 2023 02:33:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6oujhluRnYS6Pd4a2rOF0mF2eFYYLfY0cfzR4xCeFj0wLsijqRpPEL5rXDU4L2FAo/+Xi9 X-Received: by 2002:a05:6a00:843:b0:64a:2dd6:4f18 with SMTP id q3-20020a056a00084300b0064a2dd64f18mr3831574pfk.13.1684402391670; Thu, 18 May 2023 02:33:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684402391; cv=none; d=google.com; s=arc-20160816; b=CPTIn0DO25ETsfv8iWdfX4OvXS7YKXCdDaKgmc+NrbnefrWryLg0DKKrtxf123w/UJ fLag5TA5g2QOTMV3DpxLDY7sFdy1elEQYeydA3+Sa0dwv3LiStSVcowWSE0AVEnfPEEQ Tcv1HiS8kH0MuAuSNZ7kJcgEjdY3KnZdUNLHJwgPZZr5zQr7CCJRELiA82zrmQNJP6fP 4i6CB4IOi3cuGhK3HF1WWq4lfaX+IMBPSFGLdVcJV7i0TVzrTtwQBN3F8zMDVO81kHsn B+0E/gB+EzUQ/pvmtiOATgDIrgkb7Z07n45rmcDaktdTIyd3rtsY+8SRkK8Cclcv5eZG ZbWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=58L3WaLMi3VUvVs4ZbvW8nIO6OpE/Q5KdgQd/ohiyy0=; b=YJACdleGJT+oPSHQy+pW/SFz9bcOYsRWzV3I/JUsMlWS6NjJcSwsZODfzQOhb6nu6+ sNnl/wcmOMfC7NdLBtGPViMyslWyokF9j5Y4bu9lG+q9yMY9TyYffgtFshvmVV2R86h4 WxlA94Ww/bnJwBVNIrMGzpOihmr06uHBEUh53xvt1rEIzWjF/TjyvdjOTuKRnEAQZoR1 CGtIiBXIbhyS1TW8dAcyUU8MCDiRX0YydkICGGw4eo9Bsbt4Fo1StR+uOCuYUCJ+lCdS TJsimJKp9RHelnp+0Sm/6tK1JEG3TBthC6yhVR5o4EGK/fSE7GynIcAQfcdTPZd1J6si aLAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dK4qFyZA; 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 bv128-20020a632e86000000b0052c89d50011si901889pgb.676.2023.05.18.02.32.59; Thu, 18 May 2023 02:33:11 -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=dK4qFyZA; 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 S230244AbjERJ37 (ORCPT + 99 others); Thu, 18 May 2023 05:29:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbjERJ3x (ORCPT ); Thu, 18 May 2023 05:29:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3030A26B6 for ; Thu, 18 May 2023 02:29:44 -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 B201064DC4 for ; Thu, 18 May 2023 09:29:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0437C4339C; Thu, 18 May 2023 09:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684402183; bh=ovRBMbfJ+0e2fp3fL3pzSwAhC4xZCypG0p8+sBPPWG4=; h=From:To:Cc:Subject:Date:From; b=dK4qFyZA0dN8yAUQzL0S7ZuaDDKgCMkUCp6ChHtGI8CYUiXzM5K7iCKLWZ8xYLxLT bld7GfUibB0TpXwUu15G9AN6FShQKFDpCuyRFSH9EaEQRBuc4h/qGDwuI63K7rOaPH oK7hByarOUsIsUtr5fo45qAzwAbEJKIJIDSAjyn9yu4/eECkOxOcq6OAqGZAKrBp3F Ub4UDY9jICBvxWPGvuNAJ37SvuoGrGmWWH+Eg1c7q7bPSs7qqrpdmZj3WEGbIgQ1Uz FDP9QLUjlRwYqFCv5pVv5HImXJOxi8E7QczE6vehmh67uQyaxgbfiPJv+Yu/ItG74E Tg9ESaJozjm0w== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: [PATCH] f2fs: fix to use le32_to_cpu() in RAW_IS_INODE() Date: Thu, 18 May 2023 17:29:31 +0800 Message-Id: <20230518092931.2280835-1-chao@kernel.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 __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) +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