aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/f2fs-tools/patches/020-dump.f2fs-fix-incorrect-endian-conversion.patch
blob: 2420ec889fc4e88fe21d61c74163216f5a3c89ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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};