[PATCH] fs/erofs: add DEFLATE algorithm support

2024-04-14 Thread Jianan Huang
This patch adds DEFLATE compression algorithm support. It's a good choice to trade off between compression ratios and performance compared to LZ4. Alternatively, DEFLATE could be used for some specific files since EROFS supports multiple compression algorithms in one image. Signed-off-by: J

Re: [PATCH v4 2/5] lib/lz4: update LZ4 decompressor module

2024-05-26 Thread Jianan Huang
Hi Jonathan, Could you please try the following patch ? It replaces all memcpy() calls in lz4 with __builtin_memcpy(). diff --git a/lib/lz4.c b/lib/lz4.c index d365dc727c..2afe31c1c3 100644 --- a/lib/lz4.c +++ b/lib/lz4.c @@ -34,6 +34,8 @@ #include #include +#define LZ4_memcpy(dst, src, size

[PATCH] fs/erofs: fix an overflow issue of unmapped extents

2024-06-05 Thread Jianan Huang
Here the size should be `length - skip`, otherwise it could cause the destination buffer overflow. Reported-by: jianqiang wang Fixes: 65cb73057b65 ("fs/erofs: add lz4 decompression support") Signed-off-by: Jianan Huang --- fs/erofs/data.c | 2 +- 1 file changed, 1 insertion(+),

Re: [RFC PATCH 10/24] erofs: add device_infos implementation in Rust

2024-09-21 Thread Jianan Huang
Yiyang Wu via Linux-erofs 于2024年9月16日周一 21:57写道: > > Add device_infos implementation in rust. It will later be used > to be put inside the SuperblockInfo. This mask and spec can later > be used to chunk-based image file block mapping. > > Signed-off-by: Yiyang Wu > --- > fs/erofs/rust/erofs_sys/

Re: [RFC PATCH 08/24] erofs: add device data structure in Rust

2024-09-21 Thread Jianan Huang
Yiyang Wu via Linux-erofs 于2024年9月16日周一 21:57写道: > This patch introduce device data structure in Rust. > It can later support chunk based block maps. > > Signed-off-by: Yiyang Wu > --- > fs/erofs/rust/erofs_sys.rs | 1 + > fs/erofs/rust/erofs_sys/devices.rs | 28 +++

[PATCH v2] erofs-utils: avoid allocating large arrays on the stack

2024-10-24 Thread Jianan Huang via Linux-erofs
The default pthread stack size of bionic is 1M. Use malloc to avoid stack overflow. Signed-off-by: Jianan Huang --- Changes since v1: - Move the allocation and free tmp when exiting, which was mentioned by Sandeep. lib/compress.c | 33 +++-- 1 file changed, 23

[PATCH] erofs-utils: avoid allocating large arrays on the stack

2024-10-24 Thread Jianan Huang via Linux-erofs
The default pthread stack size of bionic is 1M. Use malloc to avoid stack overflow. Signed-off-by: Jianan Huang --- lib/compress.c | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/lib/compress.c b/lib/compress.c index cbd4620..47ba662 100644