From patchwork Mon Dec 10 03:58:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 1010238 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="joCTb86e"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OGk3klIK"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43Cq7R0g6Qz9s47 for ; Mon, 10 Dec 2018 14:58:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=CSlc5tLNNuAKHE0w7/AXaDnCzltq2BrVvNz/CkB1v9I=; b=joCTb86ekg1PZY gq2IpXVIdJBl5e/z1wHwi3t1b7CUA3Z4pzXGwFf9oDDhLN7D6fCv/784InFvBQIY73xSiVVHyNfG2 q36T1jn2+umuCC6nt9UBotCwlw1ruverIPxDNt6XhPXuQZXq2HdW2AAirPF8RTAPZrqXU8QeA/hwl cbuyytlWIRWJjEutSmhLLEqnwTst3unXKwkxwLg75Mm7/IWoIUgJ4BgmlR+kNrnnlvL5dfKj3BVgt ibemQlJFo79MuXjr6S17bPCDIG4C8hpwCnyCdVEik5kobZhCGzFTzyNuI3LFo5sDTW08iDAxcHSpy Oef9cvuylxAzz1jIUPBQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWCiM-0004gv-FA; Mon, 10 Dec 2018 03:58:38 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWCiJ-0004gH-J7 for openwrt-devel@lists.openwrt.org; Mon, 10 Dec 2018 03:58:37 +0000 Received: by mail-pl1-x631.google.com with SMTP id u18so4574902plq.7 for ; Sun, 09 Dec 2018 19:58:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=H0mRJ3LcHmmkXCB6HrKwL2CkUtL7L1lbZyiU/zGzULM=; b=OGk3klIKtwZlIKc5fk2nrsy6RAH/TWK8Xi2/EA/+rYsuuWUf/s8c//8/cZ5RV+/2yG DJpdNrzPt3a2crWyFdDVpB1/n+uD9WCDD/uApAw+IDCmOhXog9MaEvbkyPYfejiiEmv6 eqKASE2fSN8J3eO4egkcY5TyGBqzl5WYMfFV4EGC2kIJxgahlZHUYYfWfaklgwbVkZ9P Y6AMavojBu5ynZChncwn+QHxekyTUlUUAjCmn2Ha8pIWeJY+n0IIJN7yHR+ThVBFDF8L NyyvoG2H0VWoHu9n39bTgBNC6znRVYFC3NDsuFA+Z+p4+RxYLw+O7/wnvKD/0Ituxm8g 1NxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=H0mRJ3LcHmmkXCB6HrKwL2CkUtL7L1lbZyiU/zGzULM=; b=Blvd++tSAtBRprSPXIRN2HF4QNtfmBqXfx7atorHLzLiG/S4iB2XXwwNOggSMmq3Rl 59luBGjyxGM2zIE0xeSmh6le919mAaNFTvJ9SqaGYD6vp9TKXRPbLPPbBmSLw6gL1G9H PNhDYhSdcQbuzVgxpQdm+8TLVShE4m3ATyI+UOGyr7oCqmEFpsgTDAAGRtSU+wjVsIsQ DZU+bDyy8z4OxYnwe4TH7HjxiiCii7JQm+E72f8MXTU4HQWrMR/vQNdiXgsxRBphu8BL 6OyhUKIzGzkzJZ/lVG6cSv9TCa7Gym6060gz/WpLGL4RLKMBz4PPDhTDBjkPAOH/3RA6 K14w== X-Gm-Message-State: AA+aEWaHvLxBE/jLKLvFIYkSy2+RQbTjzIPg2m9qRf/GY4ZbeCG5h1eM 06EKB/0yK8Go/RzjuUWC7FpL41Zk X-Google-Smtp-Source: AFSGD/WWbicV/1YPruc9b9U6htjav0qg1rkPPgyowbf4ziAEux41We2MdYxpgEdzoxcsDMe8mYfEhA== X-Received: by 2002:a17:902:f44:: with SMTP id 62mr10861956ply.38.1544414303795; Sun, 09 Dec 2018 19:58:23 -0800 (PST) Received: from desktop.lan (astound-69-42-16-32.ca.astound.net. [69.42.16.32]) by smtp.gmail.com with ESMTPSA id 79sm11957290pge.66.2018.12.09.19.58.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Dec 2018 19:58:22 -0800 (PST) From: Rosen Penev To: openwrt-devel@lists.openwrt.org Date: Sun, 9 Dec 2018 19:58:21 -0800 Message-Id: <20181210035821.2849-1-rosenp@gmail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181209_195835_656982_309C01B9 X-CRM114-Status: GOOD ( 16.09 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:631 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rosenp[at]gmail.com) -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [OpenWrt-Devel] [PATCHv2] f2fs-tools: Update to 1.12.0 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org 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 --- 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 +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 +--- + 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 +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 +--- + 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 +