[PATCH] erofs-utils: bump up EROFS_CONFIG_COMPR_MAX_SZ

Gao Xiang xiang at kernel.org
Mon Jun 13 02:45:18 AEST 2022


Otherwise, compression ratios could be limited when
pcluster size is large. Use a static variable for now.

Signed-off-by: Gao Xiang <xiang at kernel.org>
---
 include/erofs/compress.h | 4 +---
 lib/compress.c           | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/erofs/compress.h b/include/erofs/compress.h
index 40df2bc..24f6204 100644
--- a/include/erofs/compress.h
+++ b/include/erofs/compress.h
@@ -14,9 +14,7 @@ extern "C"
 
 #include "internal.h"
 
-/* workaround for an upstream lz4 compression issue, which can crash us */
-/* #define EROFS_CONFIG_COMPR_MAX_SZ        (1024 * 1024) */
-#define EROFS_CONFIG_COMPR_MAX_SZ           (900  * 1024)
+#define EROFS_CONFIG_COMPR_MAX_SZ           (3000 * 1024)
 #define EROFS_CONFIG_COMPR_MIN_SZ           (32   * 1024)
 
 void z_erofs_drop_inline_pcluster(struct erofs_inode *inode);
diff --git a/lib/compress.c b/lib/compress.c
index 7ebc534..ee3b856 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -607,7 +607,7 @@ void z_erofs_drop_inline_pcluster(struct erofs_inode *inode)
 int erofs_write_compressed_file(struct erofs_inode *inode)
 {
 	struct erofs_buffer_head *bh;
-	struct z_erofs_vle_compress_ctx ctx;
+	static struct z_erofs_vle_compress_ctx ctx;
 	erofs_off_t remaining;
 	erofs_blk_t blkaddr, compressed_blocks;
 	unsigned int legacymetasize;
-- 
2.30.2



More information about the Linux-erofs mailing list