Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ocfs2: convert to host endian in ocfs2_validate_inode_block

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>

authored by

Joseph Qi and committed by
Andrew Morton
6e89373c c9dff86e

+1 -1
+1 -1
fs/ocfs2/inode.c
··· 1481 1481 goto bail; 1482 1482 } 1483 1483 1484 - if (!(di->i_flags & cpu_to_le32(OCFS2_VALID_FL))) { 1484 + if (!(le32_to_cpu(di->i_flags) & OCFS2_VALID_FL)) { 1485 1485 rc = ocfs2_error(sb, 1486 1486 "Invalid dinode #%llu: OCFS2_VALID_FL not set\n", 1487 1487 (unsigned long long)bh->b_blocknr);