linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] dump.f2fs: fix incorrect endian conversion
@ 2018-12-10  3:19 Chao Yu
  0 siblings, 0 replies; only message in thread
From: Chao Yu @ 2018-12-10  3:19 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-f2fs-devel

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(-)

diff --git a/fsck/dump.c b/fsck/dump.c
index d0e3355b726c..07dc2fcdef69 100644
--- a/fsck/dump.c
+++ b/fsck/dump.c
@@ -409,7 +409,7 @@ static void dump_file(struct f2fs_sb_info *sbi, struct node_info *ni,
 				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};
-- 
2.18.0.rc1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-10  3:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-10  3:19 [PATCH] dump.f2fs: fix incorrect endian conversion Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).