Message ID | 20230518092931.2280835-1-chao@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp361125vqo; Thu, 18 May 2023 02:40:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xzXHj8adjlG5UJ6THzdyTrXfO/50plKz8fCS9H9B0OTcwfJovXgAPGZwboQUuqPaZBAUZ X-Received: by 2002:a05:6a00:992:b0:643:440b:1af5 with SMTP id u18-20020a056a00099200b00643440b1af5mr4413713pfg.16.1684402804109; Thu, 18 May 2023 02:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684402804; cv=none; d=google.com; s=arc-20160816; b=wU8xpYCWmCx01bxErY3HaS0WAzsXr0zqkOkCevwF3qqCKSdA15x+qvghh4WcV8aCAH 8RCkr/9ARkEOW5L3IpM0TPp2C0Q4l15KTihU5jXmgpKSvy/OCf7A3+87J3wVLmr9Vz3R rTeoTcSZrIt3m2BoywozptX+rJ/HASAHcP4HekWklmR78K4EnzFrLeqpk/+J6K6NFtjP 6vBYfKHPp0JNvoHfpWC9oPMY3BUHFIY5GledtWy2mpTiknNU+ixgQZyNd2abMo2E/rd5 GeYQDU9clZE+LjuFrGnD2PY8DycMy5CEMJ1ZqpWCaqqz71b2/yZqN5bvFHXNT66lKuz2 nS0w== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 203-20020a6301d4000000b0052cc0c1c39csi997600pgb.815.2023.05.18.02.39.42; Thu, 18 May 2023 02:40:04 -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 S230077AbjERJaA (ORCPT <rfc822;abdi.embedded@gmail.com> + 99 others); Thu, 18 May 2023 05:30:00 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <linux-kernel@vger.kernel.org>; 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 <chao@kernel.org> To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu <chao@kernel.org> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766224354834541498?= X-GMAIL-MSGID: =?utf-8?q?1766224354834541498?= |
Series |
f2fs: fix to use le32_to_cpu() in RAW_IS_INODE()
|
|
Commit Message
Chao Yu
May 18, 2023, 9:29 a.m. UTC
__le32 type variable should be converted w/ le32_to_cpu() before access.
Signed-off-by: Chao Yu <chao@kernel.org>
---
fs/f2fs/f2fs.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Comments
On 05/18, Chao Yu wrote: > __le32 type variable should be converted w/ le32_to_cpu() before access. > > Signed-off-by: Chao Yu <chao@kernel.org> > --- > 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
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) {