[openwrt/openwrt] f2fs-tools: update to 1.15.0

LEDE Commits lede-commits at lists.infradead.org
Sun Jul 3 12:06:05 PDT 2022


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/8b9e806160118eb115ea26a1fbf381801185bdb6

commit 8b9e806160118eb115ea26a1fbf381801185bdb6
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Mon Jun 27 16:04:10 2022 +0200

    f2fs-tools: update to 1.15.0
    
    Add patches:
    - 100-configure.ac-fix-AC_ARG_WITH.patch
    
    Remove upstreamed patches:
    - 200-resize_f2fs-fix_wrong_ovp_calculation.patch
    
    Changelog:
    
    64f2596 f2fs-tools: upgrade version 1.15.0
    d9d5b11 f2fs-tools: build silently
    299c0b5 fsck.f2fs: fix broken file_map output
    3af62be f2fs-tools: show segment/section layout correctly
    4d9c009 f2fs-tools: use android config only if there's no config.h
    0b9b89f dump.f2fs: compress: fix dstlen of LZ4_compress_fast_extState()
    eee3969 mkfs.f2fs: check uuid library
    e5fe1a2 f2fs-tools: use fsync() in Android
    ea9921f f2fs-tools: support zoned device in Android
    a8fefc2 android_config.h: add missing liblz4
    0c54cf7 libf2fs_io: add unused mactor to avoid build failure
    6eebd13 ci: Enable -Wall, -Wextra and -Werror
    c491657 Fix PowerPC format string warnings
    70e4139 Suppress a compiler warning about integer truncation
    7a1206a Annotate switch/case fallthrough
    b964b79 Change #ifdef _WIN32 checks into #ifdef HAVE_.*
    28de4d1 tools/f2fs_io: Fix the type of 'ret'
    fdff1ab fsck/segment.c: Remove dead code
    ede3bde fsck/main.c: Suppress a compiler warning
    93c6483 tools/f2fscrypt.c: Fix build without uuid/uuid.h header file
    559e60e fsck: Remove a superfluous include directive
    98f7f56 mkfs/f2fs_format.c: Suppress a compiler warning
    ef011a4 configure.ac: Detect selinux/android.h
    2e59ab8 configure.ac: Detect the sparse/sparse.h header
    1790203 Fix the MinGW build
    ecd27dc Use %zu to format size_t
    24663b6 Include <stddef.h> instead of defining offsetof()
    cdefef0 Move the be32_to_cpu() definition
    1612bf9 Remove unnecessary __attribute__((packed)) annotations
    7a5109f f2fs_fs.h: Use standard fixed width integer types
    e61203c Suppress a compiler warning
    9425b47 Verify structure sizes at compile time
    006bb13 Change one array member into a flexible array member
    cb4c5d6 ci: Build f2fstools upon push and pull requests
    f3033fb Change the ANDROID_WINDOWS_HOST macro into _WIN32
    87d7a95 Switch from the u_int to the uint types
    c483354 configure.ac: Enable cross-compilation
    3e97d07 configure.ac: Sort header file names alphabetically
    91ba5e5 configure.ac: Enable the automake -Wall option
    ae65a15 configure.ac: Remove two prototype tests
    d24fd5c configure.ac: Stop using obsolete macros
    6afcf64 libf2fs: don't allow mkfs / fsck on non power-of-2 zoned devices
    c7757ec man: update mkfs.f2fs to give the default android option
    46e1b83 f2fs-tools: use proper 64bit types for PPC
    97ce230 mkfs.f2fs: fix wrong indentation and clean up
    0d3d26d mkfs.f2fs: set project quota by default for -g android for v4.14+
    1de1db8 f2fs-tools: add atomic write related options to f2fs_io write command
    85cd72a mkfs.f2fs: set required quota types only
    028af9f fsck.f2fs: Add progression feedback
    972d710 fsck.f2fs: do not assert if i_size is missing i_blocks in symlink
    f63551b f2fs-tools: separate other bugs in fsck_verify
    ade81b9 f2fs-tools: remove false failure alarm when fixing quota
    99bc497 f2fs-tools: fall back to the original version check when clock_gettime is not supported
    1603a3d mkfs.f2fs: wipe other FS magics given -f
    63d5004 fsck.f2fS: is_valid_summary(): check whether offset is out of bounds
    3fd996c Avoid redefined ALIGN_UP
    1edc138 fsck.f2fs: Update the usage about option of preen mode
    49159df f2fs-tools: change fiemap print out format
    8bcb58e f2fs_io: add rename w/ fsync option
    9429e86 fsck.f2fs: add basic compress related check/fix
    529967e f2fs-tools: make fiemap command in accordance with uapi
    1228009 f2fs-tools: rebuild the quota inode if it is corrupted
    9ee091e f2fs-tools: add periodic check in kernel version check
    1bc7658 dump.f2fs: minor clean ups
    69952e3 f2fs-tools: fix wrong value of reserve_new_block parameter in page_symlink
    76d2a91 f2fs-tools: add extent cache for each file
    8d464ee f2fs-tools: fix wrong file offset
    acd2518 fsck|dump.f2fs: add -M to get file map
    027488e mkfs.f2fs: remove android features for RO
    e01ad31 f2fs-tools: fix metadata region overlap with zoned block device zones
    f3b93bf sload.f2fs: Reword "IMMUTABLE" in strings/comments
    820b5e3 sload.f2fs: use F2FS_COMPRESS_RELEASED instead of IMMUTABLE bit
    1d2683f f2fs-tools: support small RO partition
    a9594c6 fsck.f2fs: add "-l" to show the layout information
    38e3115 f2fs_io: add to show immutable bit
    6afd3e9 tools: Introduce f2fslabel
    3218ff9 f2fs-tools: correct get kernel version logic
    19d49b5 dump.f2fs: fix memory leak caused by dump_node_blk()
    15d4d7b fsck.f2fs: fix memory leak caused by fsck_chk_orphan_node()
    1900c22 mkfs.f2fs: fix memory leak in not enough segments error path
    5cc365c resize.f2fs: fix memory leak caused by migrate_nat()
    870915f f2fs_io: split definition check for crypto ioctl
    91f9db2 fsck.f2fs: update kernel version in superblock on forced check
    1531853 f2fs_io: Add get file name encryption mode
    3bfcca8 f2fs-tool: increase debug level from 0 to 1 in migrate_block
    5263ae2 resize.f2fs: fix to check free space before shrink
    159752d resize.f2fs: fix wrong sit/nat bitmap during rebuild_checkpoint()
    98e6463 resize.f2fs: add force option to rewrite broken calculation
    f056fbe resize.f2fs: fix wrong ovp calculation
    80dba0f Add -P option to preserve file owner
    f0fda11 libf2fs: fix memory leak caused by get_rootdev()
    5144f2f mkfs.f2fs: add VM disk files to hot data types
    73c0871 libzoned: use blk_zone_v2 and blk_zone_report_v2 by default
    9cb5150 f2fs-tools: fix wrong blk_zone_rep_v2 definition
    15474db mkfs.f2fs: allocate zones together to avoid random access
    316e128 mkfs.f2fs: adjust zone alignment when using multi-partitions
    cc57f2c fsck.f2fs: fix alignment on multi-partition support
    ff7172e f2fs-tools: Miscellaneous cleanup to README.
    2b26417 mkfs.f2fs.8: Better document the -g argument.
    e05afe5 mkfs.f2fs.8: fix formatting for -l parameter in man page
    747b74c f2fs-tools: Make sload.f2fs reproduce hard links
    b585244 f2fs-tools:sload.f2fs compression support
    7b63f7b f2fs_io: add compress/decompress commands
    457392a f2fs-tools: Added #ifdef WITH_func
    d322d47 f2fs-tools: fix a few spelling errors in f2fs-tools
    fcd5cd0 f2fs-tools: skipped to end on error syntax error
    31d30f0 mkfs.f2fs: show a message when compression is enabled
    1d4c7e7 f2fs_io: add get/set compression option
    4bd7008 Fix ASSERT() macro with '%' in the expression
    ca0ed8a f2fs-toos: fsck.f2fs Fix bad return value
    c954e7c fsck.f2fs: do xnid sanity check only during fsck
    1bfc173 f2fs_io: add erase option
    e59bb17 mkfs.f2fs.8: document the verity feature
    8fd836f fsck: clear unexpected casefold flags
    1a7415a mkfs.f2fs: add -h and --help
    717d70d f2fs_io: change fibmap to fiemap
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 package/utils/f2fs-tools/Makefile                  |  6 +-
 .../patches/100-configure.ac-fix-AC_ARG_WITH.patch | 88 ++++++++++++++++++++++
 ...200-resize_f2fs-fix_wrong_ovp_calculation.patch | 46 -----------
 3 files changed, 91 insertions(+), 49 deletions(-)

diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile
index 3c53f27d79..8f53516d34 100644
--- a/package/utils/f2fs-tools/Makefile
+++ b/package/utils/f2fs-tools/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=f2fs-tools
-PKG_VERSION:=1.14.0
-PKG_RELEASE:=3
+PKG_VERSION:=1.15.0
+PKG_RELEASE:=1
 
 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:=619263d4e2022152a1472c1d912eaae104f20bd227ce0bb9d41d1d6608094bd1
+PKG_HASH:=147d471040b44900283ce2c935f1d35d13d7f40008e7cb8fab2b69f54da01a4f
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_LICENSE:=GPL-2.0-only
diff --git a/package/utils/f2fs-tools/patches/100-configure.ac-fix-AC_ARG_WITH.patch b/package/utils/f2fs-tools/patches/100-configure.ac-fix-AC_ARG_WITH.patch
new file mode 100644
index 0000000000..a7fb50a63d
--- /dev/null
+++ b/package/utils/f2fs-tools/patches/100-configure.ac-fix-AC_ARG_WITH.patch
@@ -0,0 +1,88 @@
+From 9af8ee5baceab59d46154c96da62b52935f363fe Mon Sep 17 00:00:00 2001
+From: Nick Hainke <vincent at systemli.org>
+Date: Mon, 27 Jun 2022 20:43:11 +0200
+Subject: [PATCH] configure.ac: fix AC_ARG_WITH
+
+In the new version the configuration no longer respects the
+--without/--with blkid/selinux parameters. Add the tests for
+"with_blkid" and "with_selinux" back to configure.ac as described
+in the manual.
+
+Link: https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/External-Software.html
+
+Fixes: 	c48335416a09 ("configure.ac: Enable cross-compilation")
+
+Signed-off-by: Nick Hainke <vincent at systemli.org>
+---
+ configure.ac | 44 ++++++++++++++++++++++++++++++--------------
+ 1 file changed, 30 insertions(+), 14 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -39,12 +39,16 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign
+ 
+ # Test configure options.
+ AC_ARG_WITH([selinux],
+-	AS_HELP_STRING([--without-selinux],
+-	  [Ignore presence of libselinux and disable selinux support]))
++	[AS_HELP_STRING([--without-selinux],
++	  [Ignore presence of libselinux and disable selinux support])],
++	[],
++	[with_selinux=check])
+ 
+ AC_ARG_WITH([blkid],
+-	AS_HELP_STRING([--without-blkid],
+-	  [Ignore presence of libblkid and disable blkid support]))
++	[AS_HELP_STRING([--without-blkid],
++	  [Ignore presence of libblkid and disable blkid support])],
++	[],
++	[with_blkid=check])
+ 
+ # Checks for programs.
+ AC_PROG_CC
+@@ -55,11 +59,17 @@ AC_PATH_PROG([LDCONFIG], [ldconfig],
+        [$PATH:/sbin])
+ 
+ # Checks for libraries.
+-AC_CHECK_LIB([blkid], [blkid_probe_all],
+-	[AC_SUBST([libblkid_LIBS], ["-lblkid"])
+-		AC_DEFINE([HAVE_LIBBLKID], [1],
+-		[Define if you have libblkid])
+-	], [], [])
++AS_IF([test "x$with_blkid" != xno],
++	[AC_CHECK_LIB([blkid], [blkid_probe_all],
++		[AC_SUBST([libblkid_LIBS], ["-lblkid"])
++			AC_DEFINE([HAVE_LIBBLKID], [1],
++			[Define if you have libblkid])
++		],
++		[if test "x$with_blkid" != xcheck; then
++			AC_MSG_FAILURE(
++                [--with-blkid was given, but test for blkid failed])
++        fi
++	], -lblkid)])
+ 
+ AC_CHECK_LIB([lzo2], [main],
+ 	[AC_SUBST([liblzo2_LIBS], ["-llzo2"])
+@@ -73,11 +83,17 @@ AC_CHECK_LIB([lz4], [main],
+ 		[Define if you have liblz4])
+ 	], [], [])
+ 
+-AC_CHECK_LIB([selinux], [getcon],
+-	[AC_SUBST([libselinux_LIBS], ["-lselinux"])
+-		AC_DEFINE([HAVE_LIBSELINUX], [1],
+-		[Define if you have libselinux])
+-	], [], [])
++AS_IF([test "x$with_selinux" != xno],
++	[AC_CHECK_LIB([selinux], [getcon],
++		[AC_SUBST([libselinux_LIBS], ["-lselinux"])
++			AC_DEFINE([HAVE_LIBSELINUX], [1],
++			[Define if you have libselinux])
++		],
++		[if test "x$with_selinux" != xcheck; then
++			AC_MSG_FAILURE(
++				[--with-selinux was given, but test for selinux failed])
++		fi
++	], -lselinux)])
+ 
+ AC_CHECK_LIB([uuid], [uuid_clear],
+ 	[AC_SUBST([libuuid_LIBS], ["-luuid"])
diff --git a/package/utils/f2fs-tools/patches/200-resize_f2fs-fix_wrong_ovp_calculation.patch b/package/utils/f2fs-tools/patches/200-resize_f2fs-fix_wrong_ovp_calculation.patch
deleted file mode 100644
index 0b433f76c4..0000000000
--- a/package/utils/f2fs-tools/patches/200-resize_f2fs-fix_wrong_ovp_calculation.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From f056fbeff08d30a6d9acdb9e06704461ceee3500 Mon Sep 17 00:00:00 2001
-From: Jaegeuk Kim <jaegeuk at kernel.org>
-Date: Thu, 1 Apr 2021 20:13:55 -0700
-Subject: resize.f2fs: fix wrong ovp calculation
-
-beroal reported a mount failure due to broken valid_user_blocks.
-[ 6890.647749] F2FS-fs (loop0): Wrong valid_user_blocks: 16040048,
-user_block_count: 10016768
-
-From fsck,
-
-segment_count_main                      [0x    9a95 : 39573]
--> 39573 * 2MB = 78GB as user space
-
-overprov_segment_count                  [0x    4e29 : 20009]
--> 20009 * 2MB = 40GB as overprovisioned space which user can't see.
-
-But,
-[FSCK] valid_block_count matching with CP             [Ok..] [0xf4c070]
--> 0xf4c070 = 16040048
-
-valid_block_count                       [0x  f4c070 : 16040048]
--> So, this is correct.
-
-It turns out resize.f2fs gave very large and wrong overprovisioning space
-result in shortage of user blocks. The root cause was f2fs_get_usable_segments()
-didn't consider resize case which needs segment_count_main from new superblock.
-
-Fixes: f8410857b7a8 ("f2fs-tools: zns zone-capacity support")
-Signed-off-by: Jaegeuk Kim <jaegeuk at kernel.org>
----
- lib/libf2fs_zoned.c | 3 +++
- 1 file changed, 3 insertions(+)
-
---- a/lib/libf2fs_zoned.c
-+++ b/lib/libf2fs_zoned.c
-@@ -495,6 +495,9 @@ uint32_t f2fs_get_usable_segments(struct
- 	int i, j;
- 	uint32_t usable_segs = 0, zone_segs;
- 
-+	if (c.func == RESIZE)
-+		return get_sb(segment_count_main);
-+
- 	for (i = 0; i < c.ndevs; i++) {
- 		if (c.devices[i].zoned_model != F2FS_ZONED_HM) {
- 			usable_segs += c.devices[i].total_segments;




More information about the lede-commits mailing list