]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ocfs2: convert to host endian in ocfs2_validate_inode_block
authorJoseph Qi <joseph.qi@linux.alibaba.com>
Sat, 25 Oct 2025 12:32:18 +0000 (20:32 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 12 Nov 2025 18:00:16 +0000 (10:00 -0800)
Convert to host endian when checking OCFS2_VALID_FL to keep consistent
with other checks.

Link: https://lkml.kernel.org/r/20251025123218.3997866-2-joseph.qi@linux.alibaba.com
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Heming Zhao <heming.zhao@suse.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/inode.c

index 0a0a96054bfecb976dbd3d4ea2767f58ae380761..dc4044a565b5d02bd0f72cb3b58fa3444caf8cba 100644 (file)
@@ -1481,7 +1481,7 @@ int ocfs2_validate_inode_block(struct super_block *sb,
                goto bail;
        }
 
-       if (!(di->i_flags & cpu_to_le32(OCFS2_VALID_FL))) {
+       if (!(le32_to_cpu(di->i_flags) & OCFS2_VALID_FL)) {
                rc = ocfs2_error(sb,
                                 "Invalid dinode #%llu: OCFS2_VALID_FL not set\n",
                                 (unsigned long long)bh->b_blocknr);