[OpenWrt-Devel] [PATCHv2] f2fs-tools: Update to 1.12.0

Rosen Penev rosenp at gmail.com
Sun Dec 9 22:58:21 EST 2018


Added two upstream mailing list patches that fix behavior under big endian
systems. Issue was present since version 1.11.0.

Tested on Turris Omnia.

Original discussion: https://github.com/openwrt/openwrt/pull/1575

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 v2: Added big endian patches.
 package/utils/f2fs-tools/Makefile             |  4 +-
 .../010-fsck-Fix-big-endian-platforms.patch   | 40 +++++++++++++++++++
 ...f2fs-fix-incorrect-endian-conversion.patch | 29 ++++++++++++++
 3 files changed, 71 insertions(+), 2 deletions(-)
 create mode 100644 package/utils/f2fs-tools/patches/010-fsck-Fix-big-endian-platforms.patch
 create mode 100644 package/utils/f2fs-tools/patches/020-dump.f2fs-fix-incorrect-endian-conversion.patch

diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile
index 659b3d244c..b782b80670 100644
--- a/package/utils/f2fs-tools/Makefile
+++ b/package/utils/f2fs-tools/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=f2fs-tools
-PKG_VERSION:=1.11.0
+PKG_VERSION:=1.12.0
 PKG_RELEASE:=1
 
 PKG_LICENSE:=GPLv2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/
-PKG_HASH:=b916ac7cda902502cf18de98da94921f71edbab40fb0437d757f0716191c79e3
+PKG_HASH:=e2124e4dffaba865d41495d817bcb924d096adaec67ff777b8c7da99aa13f696
 
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
diff --git a/package/utils/f2fs-tools/patches/010-fsck-Fix-big-endian-platforms.patch b/package/utils/f2fs-tools/patches/010-fsck-Fix-big-endian-platforms.patch
new file mode 100644
index 0000000000..8715dc2cde
--- /dev/null
+++ b/package/utils/f2fs-tools/patches/010-fsck-Fix-big-endian-platforms.patch
@@ -0,0 +1,40 @@
+From 46772bbf0d978512423923da461ceb6b6e791c91 Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp at gmail.com>
+Date: Fri, 7 Dec 2018 17:39:03 -0800
+Subject: [PATCH] fsck: Fix big endian platforms
+
+Since "fsck.f2fs: integrate sanity_check_inode to __check_inode_mode",
+big endian platforms have been broken due to an endianness bug.
+
+More info: https://github.com/openwrt/openwrt/pull/1575
+
+Signed-off-by: Rosen Penev <rosenp at gmail.com>
+---
+ fsck/fsck.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/fsck/fsck.c b/fsck/fsck.c
+index 366ba13..73901d1 100644
+--- a/fsck/fsck.c
++++ b/fsck/fsck.c
+@@ -339,7 +339,7 @@ out:
+ 	return ret;
+ }
+ 
+-static int __check_inode_mode(u32 nid, enum FILE_TYPE ftype, u32 mode)
++static int __check_inode_mode(u32 nid, enum FILE_TYPE ftype, u16 mode)
+ {
+ 	if (ftype >= F2FS_FT_MAX)
+ 		return 0;
+@@ -457,7 +457,7 @@ static int sanity_check_nid(struct f2fs_sb_info *sbi, u32 nid,
+ 		return 0;
+ 
+ 	if (ntype == TYPE_INODE &&
+-		__check_inode_mode(nid, ftype, le32_to_cpu(node_blk->i.i_mode)))
++		__check_inode_mode(nid, ftype, le16_to_cpu(node_blk->i.i_mode)))
+ 		return -EINVAL;
+ 
+ 	/* workaround to fix later */
+-- 
+2.19.2
+
diff --git a/package/utils/f2fs-tools/patches/020-dump.f2fs-fix-incorrect-endian-conversion.patch b/package/utils/f2fs-tools/patches/020-dump.f2fs-fix-incorrect-endian-conversion.patch
new file mode 100644
index 0000000000..d999cc44fc
--- /dev/null
+++ b/package/utils/f2fs-tools/patches/020-dump.f2fs-fix-incorrect-endian-conversion.patch
@@ -0,0 +1,29 @@
+From a1241763f50d20efc42910e922b9c8845814f024 Mon Sep 17 00:00:00 2001
+From: Chao Yu <yuchao0 at 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 at huawei.com>
+---
+ fsck/dump.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fsck/dump.c b/fsck/dump.c
+index 8cf431c..b2df4ba 100644
+--- a/fsck/dump.c
++++ b/fsck/dump.c
+@@ -407,7 +407,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.19.2
+
-- 
2.19.2


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list