diff options
author | Rosen Penev <rosenp@gmail.com> | 2018-12-07 17:45:31 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-01-03 20:39:13 -0800 |
commit | cec37b066b3274c85035d6d4214d862834ed8020 (patch) | |
tree | e2817dab4785be095cf8dc832dd8efa41431077e | |
parent | bbff9a6d04aca4f126ff5c0b3cffcdb04ad290b6 (diff) | |
download | f2fs-tools-cec37b066b3274c85035d6d4214d862834ed8020.tar.gz |
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 <rosenp@gmail.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fsck/fsck.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fsck/fsck.c b/fsck/fsck.c index bcda781..3ad05fb 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -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 */ |