[PATCH] erofs-utils: mkfs: set LZ4_0PADDING unconditionally

Gao Xiang hsiangkao at linux.alibaba.com
Tue Dec 30 17:17:56 AEDT 2025


LZ4_0PADDING has been set unconditionally since very early Linux
EROFS versions (kernel < 5.4).

As those pre-5.10 kernels are end-of-life, just drop support for
disabling LZ4_0PADDING now.

Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
---
 include/erofs/importer.h | 1 -
 lib/compress.c           | 3 +--
 mkfs/main.c              | 6 +++---
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/include/erofs/importer.h b/include/erofs/importer.h
index a9d9c569d157..a525b474f1d5 100644
--- a/include/erofs/importer.h
+++ b/include/erofs/importer.h
@@ -51,7 +51,6 @@ struct erofs_importer_params {
 	bool dot_omitted;
 	bool no_xattrs;			/* don't store extended attributes */
 	bool no_zcompact;
-	bool no_lz4_0padding;
 	bool ztailpacking;
 	char dedupe;
 	bool fragments;
diff --git a/lib/compress.c b/lib/compress.c
index 7a5d4374afe2..58d1f4de09db 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -2186,8 +2186,7 @@ int z_erofs_compress_init(struct erofs_importer *im)
 	} else {
 		sbi->available_compr_algs = available_compr_algs;
 
-		if (!params->no_lz4_0padding)
-			erofs_sb_set_lz4_0padding(sbi);
+		erofs_sb_set_lz4_0padding(sbi);
 		if (available_compr_algs & ~(1 << Z_EROFS_COMPRESSION_LZ4))
 			erofs_sb_set_compr_cfgs(sbi);
 	}
diff --git a/mkfs/main.c b/mkfs/main.c
index aaa0300bca1b..b45368f301f3 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -325,9 +325,9 @@ static int erofs_mkfs_feat_set_legacy_compress(struct erofs_importer_params *par
 {
 	if (vallen)
 		return -EINVAL;
-	/* disable compacted indexes and 0padding */
-	params->no_zcompact = true;
-	params->no_lz4_0padding = true;
+	if (en)
+		erofs_warn("ancient !lz4_0padding layout (< Linux 5.4) is no longer supported");
+	params->no_zcompact = en;
 	return 0;
 }
 
-- 
2.43.5



More information about the Linux-erofs mailing list