openwrt/package/utils/f2fs-tools/patches/020-dump.f2fs-fix-incorrect-endian-conversion.patch

25 lines
835 B
Diff
Raw Normal View History

From a1241763f50d20efc42910e922b9c8845814f024 Mon Sep 17 00:00:00 2001
From: Chao Yu <yuchao0@huawei.com>
Date: Sun, 9 Dec 2018 19:41:52 -0800
Subject: [PATCH] dump.f2fs: fix incorrect endian conversion
f2fs_inode.i_mode is variable of __le16 type, during endian converison,
it should to use le16_to_cpu instead of le32_to_cpu, fix it.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
fsck/dump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fsck/dump.c
+++ b/fsck/dump.c
@@ -407,7 +407,7 @@ static void dump_file(struct f2fs_sb_inf
struct f2fs_node *node_blk, int force)
{
struct f2fs_inode *inode = &node_blk->i;
- u32 imode = le32_to_cpu(inode->i_mode);
+ u32 imode = le16_to_cpu(inode->i_mode);
u32 namelen = le32_to_cpu(inode->i_namelen);
char name[F2FS_NAME_LEN + 1] = {0};
char path[1024] = {0};