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

Configure Feed

Select the types of activity you want to include in your feed.

ocfs2: use correct endian in ocfs2_dinode_has_extents

Fields in ocfs2_dinode is little endian, covert to host endian when
checking those contents.

Link: https://lkml.kernel.org/r/20251025123218.3997866-1-joseph.qi@linux.alibaba.com
Fixes: fdbb6cd96ed5 ("ocfs2: correct l_next_free_rec in online check")
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Heming Zhao <heming.zhao@suse.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Joseph Qi and committed by
Andrew Morton
c9dff86e 390ac56c

+6 -4
+6 -4
fs/ocfs2/inode.c
··· 201 201 static int ocfs2_dinode_has_extents(struct ocfs2_dinode *di) 202 202 { 203 203 /* inodes flagged with other stuff in id2 */ 204 - if (di->i_flags & (OCFS2_SUPER_BLOCK_FL | OCFS2_LOCAL_ALLOC_FL | 205 - OCFS2_CHAIN_FL | OCFS2_DEALLOC_FL)) 204 + if (le32_to_cpu(di->i_flags) & 205 + (OCFS2_SUPER_BLOCK_FL | OCFS2_LOCAL_ALLOC_FL | OCFS2_CHAIN_FL | 206 + OCFS2_DEALLOC_FL)) 206 207 return 0; 207 208 /* i_flags doesn't indicate when id2 is a fast symlink */ 208 - if (S_ISLNK(di->i_mode) && di->i_size && di->i_clusters == 0) 209 + if (S_ISLNK(le16_to_cpu(di->i_mode)) && le64_to_cpu(di->i_size) && 210 + !le32_to_cpu(di->i_clusters)) 209 211 return 0; 210 - if (di->i_dyn_features & OCFS2_INLINE_DATA_FL) 212 + if (le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_DATA_FL) 211 213 return 0; 212 214 213 215 return 1;