1
0

010-fsck-Fix-big-endian-platforms.patch 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From 46772bbf0d978512423923da461ceb6b6e791c91 Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Fri, 7 Dec 2018 17:39:03 -0800
  4. Subject: [PATCH] fsck: Fix big endian platforms
  5. Since "fsck.f2fs: integrate sanity_check_inode to __check_inode_mode",
  6. big endian platforms have been broken due to an endianness bug.
  7. More info: https://github.com/librecmc/librecmc/pull/1575
  8. Signed-off-by: Rosen Penev <rosenp@gmail.com>
  9. ---
  10. fsck/fsck.c | 4 ++--
  11. 1 file changed, 2 insertions(+), 2 deletions(-)
  12. --- a/fsck/fsck.c
  13. +++ b/fsck/fsck.c
  14. @@ -339,7 +339,7 @@ out:
  15. return ret;
  16. }
  17. -static int __check_inode_mode(u32 nid, enum FILE_TYPE ftype, u32 mode)
  18. +static int __check_inode_mode(u32 nid, enum FILE_TYPE ftype, u16 mode)
  19. {
  20. if (ftype >= F2FS_FT_MAX)
  21. return 0;
  22. @@ -457,7 +457,7 @@ static int sanity_check_nid(struct f2fs_
  23. return 0;
  24. if (ntype == TYPE_INODE &&
  25. - __check_inode_mode(nid, ftype, le32_to_cpu(node_blk->i.i_mode)))
  26. + __check_inode_mode(nid, ftype, le16_to_cpu(node_blk->i.i_mode)))
  27. return -EINVAL;
  28. /* workaround to fix later */