020-dump.f2fs-fix-incorrect-endian-conversion.patch 835 B

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