fsck: Fix big endian platforms
PATCH 1/1 fsck: Fix big endian platforms
Since "fsck.f2fs: integrate sanity_check_inode to __check_inode_mode", big endian platforms have been broken due to an endianness bug.
More info: https://github.com/openwrt/openwrt/pull/1575
Signed-off-by Rosen Penev <[email protected]>
--- fsck/fsck.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fsck/fsck.c +2 -2
@@ -339,7 +339,7 @@ out:return ret; } -static int __check_inode_mode (u32 nid,enum FILE_TYPE ftype,u32 mode) +static int __check_inode_mode (u32 nid,enum FILE_TYPE ftype,u16 mode) {if (ftype >=F2FS_FT_MAX )return 0 ;
@@ -457,7 +457,7 @@ static int sanity_check_nid(struct f2fs_sb_info *sbi, u32 nid,return 0 ;if (ntype ==TYPE_INODE && -__check_inode_mode (nid, ftype,le32_to_cpu (node_blk->i.i_mode))) +__check_inode_mode (nid, ftype,le16_to_cpu (node_blk->i.i_mode)))return -EINVAL ;/* workaround to fix later */
Signature · 1 line
2.19.2
Quoted 4 lines · Rosen Penev
Since "fsck.f2fs: integrate
sanity_check_inodeto__check_inode_mode", big endian platforms have been broken due to an endianness bug.More info: https://github.com/openwrt/openwrt/pull/1575
Nice catch!
Quoted 2 lines
Signed-off-by Rosen Penev <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,