Re: [PATCH v7 4/4] erofs-utils: mkfs: support EROFS meta-only image generation from S3

2025-08-08 Thread Gao Xiang
On 2025/8/8 15:16, zhaoyifan (H) wrote: Tested: - special filename: 'test%^&hidden.txt'  'test space.txt'  '测试文件.txt' - manyfiles (>1000) directory - path-style obs backend Tested-by: Yifan Zhao Thanks, let me merge into -dev now. Thanks, Gao Xiang

Re: [PATCH v7 4/4] erofs-utils: mkfs: support EROFS meta-only image generation from S3

2025-08-08 Thread Gao Xiang
;     break;  #endif     case 'V': No, users need to specify `--clean=0` to make it work. The default mode is still -EOPNOTSUPP. Thanks, Gao Xiang Thanks, Hongbo +    err = -EOPNOTSUPP; +    else +    err = s3erofs_build_

[PATCH v2] erofs-utils: mkfs: support AWS_{ACCESS_KEY_ID,SECRET_ACCESS_KEY}

2025-08-07 Thread Gao Xiang
https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html Signed-off-by: Gao Xiang --- mkfs/main.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/mkfs/main.c b/mkfs/main.c index 07bc3ed..d3bd1cd 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -1737,6

Re: [PATCH v7 3/4] erofs-utils: mkfs: introduce --s3=... option

2025-08-07 Thread Gao Xiang
the memory. oh, buf is stack variable, memset is unuse. ;) I will merge this series to -dev branch today, feel free to submit any following improvement for this work. Thanks, Gao Xiang

[PATCH] erofs-utils: mkfs: support AWS_{ACCESS_KEY_ID,SECRET_ACCESS_KEY}

2025-08-07 Thread Gao Xiang
https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html Signed-off-by: Gao Xiang --- mkfs/main.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/mkfs/main.c b/mkfs/main.c index 07bc3ed..4e65978 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -1737,6

[PATCH v7 4/4] erofs-utils: mkfs: support EROFS meta-only image generation from S3

2025-08-07 Thread Gao Xiang
supported; - The S3 object names and sizes are strictly respected during image generation. Co-developed-by: Hongbo Li Signed-off-by: Hongbo Li Signed-off-by: Yifan Zhao Signed-off-by: Gao Xiang --- v7: - Fix `NextMarker` omission on the standard AWS S3; - Add `prefix` support for S3

[PATCH v7 3/4] erofs-utils: mkfs: introduce --s3=... option

2025-08-07 Thread Gao Xiang
); - S3 API calling style (optional); - S3 API signature version (optional, only V2 is currently supported). Signed-off-by: Yifan Zhao Signed-off-by: Gao Xiang --- lib/liberofs_s3.h | 40 mkfs/main.c | 226 +++--- 2 files changed, 234

[PATCH v7 1/4] erofs-utils: mkfs: introduce source_mode enumeration

2025-08-07 Thread Gao Xiang
logic. Signed-off-by: Yifan Zhao Reviewed-by: Hongbo Li Signed-off-by: Gao Xiang --- mkfs/main.c | 78 ++--- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/mkfs/main.c b/mkfs/main.c index dc2df06..ab27b77 100644 --- a/mkfs/main.c +++ b

[PATCH v7 2/4] erofs-utils: introduce extra build dependencies for S3 support

2025-08-07 Thread Gao Xiang
igned-off-by: Gao Xiang --- configure.ac | 129 ++- lib/Makefile.am | 1 + mkfs/Makefile.am | 3 +- 3 files changed, 131 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index da6ae48..7769ac9 100644 --- a/configure.ac

[PATCH] erofs: fix block count report when 48-bit layout is on

2025-08-07 Thread Gao Xiang
Fix incorrect shift order when combining the 48-bit block count. Fixes: 2e1473d5195f ("erofs: implement 48-bit block addressing for unencoded inodes") Signed-off-by: Gao Xiang --- fs/erofs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/erofs/su

[PATCH v6 4/4] erofs-utils: mkfs: support EROFS meta-only image generation from S3

2025-08-07 Thread Gao Xiang
supported; - The S3 object names and sizes are strictly respected during image generation. Co-developed-by: Hongbo Li Signed-off-by: Hongbo Li Signed-off-by: Yifan Zhao Signed-off-by: Gao Xiang --- v6: - code styling fixes; - support nanosecond timestamps. lib/Makefile.am | 3 + lib

[PATCH v6 2/4] erofs-utils: introduce extra build dependencies for S3 support

2025-08-07 Thread Gao Xiang
igned-off-by: Gao Xiang --- configure.ac | 129 ++- lib/Makefile.am | 1 + mkfs/Makefile.am | 3 +- 3 files changed, 131 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index da6ae48..7769ac9 100644 --- a/configure.ac

[PATCH v6 3/4] erofs-utils: mkfs: introduce --s3=... option

2025-08-07 Thread Gao Xiang
); - S3 API calling style (optional); - S3 API signature version (optional, only V2 is currently supported). Signed-off-by: Yifan Zhao Signed-off-by: Gao Xiang --- lib/liberofs_s3.h | 40 mkfs/main.c | 226 +++--- 2 files changed, 234

[PATCH v6 1/4] erofs-utils: mkfs: introduce source_mode enumeration

2025-08-07 Thread Gao Xiang
logic. Signed-off-by: Yifan Zhao Reviewed-by: Hongbo Li Signed-off-by: Gao Xiang --- v6: add Hongbo's RVB tag. mkfs/main.c | 78 ++--- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/mkfs/main.c b/mkfs/main.c index dc2df06..ab27

Re: [PATCH v6 3/4] erofs-utils: mkfs: introduce --s3=... option

2025-08-06 Thread Gao Xiang
On 2025/8/7 11:43, Hongbo Li wrote: Hi Xiang, On 2025/8/7 11:08, Gao Xiang wrote: From: Yifan Zhao It introduces configuration options for the upcoming experimental S3 support, including configuration parsing and `passwd_file` reading logic. Users can specify the following options

[PATCH v6 3/4] erofs-utils: mkfs: introduce --s3=... option

2025-08-06 Thread Gao Xiang
); - S3 API calling style (optional); - S3 API signature version (optional, only V2 is currently supported). Signed-off-by: Yifan Zhao Signed-off-by: Gao Xiang --- lib/liberofs_s3.h | 40 mkfs/main.c | 226 +++--- 2 files changed, 234

[PATCH v6 4/4] erofs-utils: mkfs: support EROFS meta-only image generation from S3

2025-08-06 Thread Gao Xiang
supported; - The S3 object names and sizes are strictly respected during image generation. Co-Developed-by: Hongbo Li Signed-off-by: Hongbo Li Signed-off-by: Yifan Zhao Signed-off-by: Gao Xiang --- lib/Makefile.am | 3 + lib/liberofs_s3.h | 2 + lib/remotes/s3.c | 622

[PATCH v6 2/4] erofs-utils: introduce extra build dependencies for S3 support

2025-08-06 Thread Gao Xiang
igned-off-by: Gao Xiang --- configure.ac | 129 ++- lib/Makefile.am | 1 + mkfs/Makefile.am | 3 +- 3 files changed, 131 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index da6ae48..7769ac9 100644 --- a/configure.ac

[PATCH v6 1/4] erofs-utils: mkfs: introduce source_mode enumeration

2025-08-06 Thread Gao Xiang
logic. Signed-off-by: Yifan Zhao Signed-off-by: Gao Xiang --- mkfs/main.c | 78 ++--- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/mkfs/main.c b/mkfs/main.c index dc2df06..ab27b77 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -244,7 +

[PATCH v3 2/2] erofs-utils: introduce metadata compression [metabox]

2025-08-06 Thread Gao Xiang
save metadata space: $ mkfs.erofs -zlzma -C1048576 -m4096:lz4hc,12 foo.erofs foo Or $ mkfs.erofs -zlzma:lz4hc,12 -C1048576 -m4096:1 foo.erofs foo will compress metadata in 4096-byte pclusters using LZ4HC level 12. Signed-off-by: Gao Xiang --- change since v2: - Assign EROFS_NID_UNALLOCATED

[PATCH v5 1/4] erofs-utils: mkfs: introduce source_mode enumeration

2025-08-06 Thread Gao Xiang
logic. Signed-off-by: Yifan Zhao Signed-off-by: Gao Xiang --- mkfs/main.c | 78 ++--- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/mkfs/main.c b/mkfs/main.c index dc2df06..ab27b77 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -244,7 +

[PATCH v5 4/4] erofs-utils: mkfs: support EROFS meta-only image generation from S3

2025-08-06 Thread Gao Xiang
supported; - The S3 object names and sizes are strictly respected during image generation. Co-Developed-by: Hongbo Li Signed-off-by: Hongbo Li Signed-off-by: Yifan Zhao Signed-off-by: Gao Xiang --- lib/Makefile.am | 3 + lib/liberofs_s3.h | 2 + lib/remotes/s3.c | 621

[PATCH v5 3/4] erofs-utils: mkfs: introduce --s3=... option

2025-08-06 Thread Gao Xiang
); - S3 API calling style (optional); - S3 API signature version (optional, only V2 is currently supported). Signed-off-by: Yifan Zhao Signed-off-by: Gao Xiang --- lib/liberofs_s3.h | 40 + mkfs/main.c | 218 -- 2 files changed, 229

[PATCH v5 2/4] erofs-utils: introduce extra build dependencies for S3 support

2025-08-06 Thread Gao Xiang
igned-off-by: Gao Xiang --- configure.ac | 129 ++- lib/Makefile.am | 1 + mkfs/Makefile.am | 3 +- 3 files changed, 131 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index da6ae48..7769ac9 100644 --- a/configure.ac

[PATCH] erofs-utils: dump: display minimum kernel version for ondisk features

2025-08-05 Thread Gao Xiang
Allow users to identify the minimum supported upstream kernel version. Signed-off-by: Gao Xiang --- dump/main.c | 52 +--- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/dump/main.c b/dump/main.c index 38cc8a2..0388830 100644

[PATCH] erofs-utils: fsck: skip erofs_verify_xattr() if xattr_isize is 0

2025-08-05 Thread Gao Xiang
erofs_dev_read() will fill with zeroes so this issue has no functional impact, but this behavior will be changed. Fixes: f44043561491 ("erofs-utils: introduce fsck.erofs") Signed-off-by: Gao Xiang --- fsck/main.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) di

[PATCH v2 2/2] erofs-utils: introduce metadata compression [metabox]

2025-08-05 Thread Gao Xiang
save metadata space: $ mkfs.erofs -zlzma -C1048576 -m4096:lz4hc,12 foo.erofs foo Or $ mkfs.erofs -zlzma:lz4hc,12 -C1048576 -m4096:1 foo.erofs foo will compress metadata in 4096-byte pclusters using LZ4HC level 12. Signed-off-by: Gao Xiang --- include/erofs/blobchunk.h | 3 +- include

[PATCH v2 1/2] erofs-utils: dump,fsck,fuse: support metadata compression

2025-08-05 Thread Gao Xiang
Source kernel commit: 3f59153f08cc7ab3d6686f6ee1960232fd0426d3 Source kernel commit: c1fed66045986c0f0153912a87b0de511f8781a7 Signed-off-by: Gao Xiang --- v1: https://lore.kernel.org/r/20250718065419.3338307-10-hsiang...@linux.alibaba.com changes since v1: - Fill up the final commit ids

[PATCH] erofs-utils: fuse: fix compile error with older libfuse versions

2025-08-04 Thread Gao Xiang
Fixes: a43529e6c912 ("erofs-utils: fuse: kernel caching for readdir") Signed-off-by: Gao Xiang --- configure.ac | 5 + fuse/main.c | 4 2 files changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index 2d42b1f..da6ae48 100644 --- a/configure.ac +++ b/co

Re: [PATCH v3] erofs: fix atomic context detection when !CONFIG_DEBUG_LOCK_ALLOC

2025-08-04 Thread Gao Xiang
, expected: 0 [2] https://lore.kernel.org/r/58b661d0-0ebb-4b45-a10d-c5927fb791cd@paulmck-laptop Signed-off-by: Junli Liu This version seems applicable to me: Reviewed-by: Gao Xiang Thanks, Gao Xiang

Re: [PATCH v2] erofs: fix atomic context detection when !CONFIG_DEBUG_LOCK_ALLOC

2025-08-04 Thread Gao Xiang
r/58b661d0-0ebb-4b45-a10d-c5927fb791cd@paulmck-laptop Since "Link:" tag mainly refers to the your current patch in the lore... Thanks, Gao Xiang Signed-off-by: Junli Liu --- fs/erofs/zdata.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/erofs/zd

Re: [PATCH] erofs: Fix detection of atomic context to prevent sleeping in invalid context

2025-08-04 Thread Gao Xiang
() || rcu_read_lock_any_held()) { + + if (z_erofs_in_atomic()) { Please avoid the unnecessary new line in the next version. Thanks, Gao XIang

Re: [PATCH v3] erofs: Fallback to normal access if DAX is not supported on extra device

2025-08-04 Thread Gao Xiang
on that device will be inaccessible. Signed-off-by: Yuezhang Mo Reviewed-by: Friendy Su Reviewed-by: Jacky Cao Reviewed-by: Daniel Palmer Still looks good to me, will apply after -rc1 is out: Reviewed-by: Gao Xiang Thanks, Gao Xiang

Re: [PATCH v2 3/4] erofs-utils: mkfs: introduce `--s3=...` option

2025-08-01 Thread Gao Xiang
On 2025/8/1 17:10, Hongbo Li wrote: On 2025/8/1 16:37, Gao Xiang wrote: Hi Hongbo, On 2025/8/1 16:31, Hongbo Li wrote: ... +#ifdef HAVE_S3 HAVE_S3 is a bit odd, how about using S3_ENABLED (like LZ4_ENABLED?) +    " --s3=X    generate an index-only image fr

Re: [PATCH v2 3/4] erofs-utils: mkfs: introduce `--s3=...` option

2025-08-01 Thread Gao Xiang
s not needed in this patch, maybe a follow-up patch.) Also even I agree it's useful for security purposes, it's still useful to have an _alternative_ way to pass in plain ak/sk if possible. `passwd_file` makes sense to me now since s3fs-fuse uses this name too! Thanks, Gao Xiang [1] h

Re: [PATCH v2 4/4] erofs-utils: mkfs: support EROFS index-only image generation from S3

2025-08-01 Thread Gao Xiang
easy_setopt(easy_curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt(easy_curl, CURLOPT_TIMEOUT, 30L); + + xmlInitParser(); + + return ret; +} + +static void s3erofs_global_exit(void) +{ + if (!easy_curl) + return; + + xmlCleanupParser(); + + curl_easy_cleanup(easy_curl); + easy_curl = NULL; + + curl_global_cleanup(); +} + +int s3erofs_build_trees(struct erofs_inode *root, struct erofs_s3 *s3cfg) +{ + struct erofs_sb_info *sbi = root->sbi; + struct s3erofs_object_iterator *iter; + struct s3erofs_object_info *obj; + struct erofs_dentry *d; + struct erofs_inode *inode; + struct stat st; + bool dumb; + int ret = 0; + + st.st_uid = getuid(); + st.st_gid = getgid(); + + /* XXX */ + st.st_mtime = sbi->epoch; st.st_mtime = sbi->epoch + sbi->build_time? build_time can be specified by users too. Thanks, Gao Xiang

Re: [PATCH v2 3/4] erofs-utils: mkfs: introduce `--s3=...` option

2025-08-01 Thread Gao Xiang
headerball=file data is omited in the source stream)\n" @@ -247,6 +257,10 @@ static struct erofs_tarfile erofstar = { static bool incremental_mode; static u8 metabox_algorithmid; +#ifdef HAVE_S3 +static struct erofs_s3 s3cfg; +#endif + enum { EROFS_MKFS_DATA_IMPORT_DEFAULT, EROFS_MKFS_DATA_IMPORT_FULLDATA, @@ -257,6 +271,9 @@ enum { enum { EROFS_MKFS_SOURCE_DEFAULT, EROFS_MKFS_SOURCE_LOCALDIR, Thanks, Gao Xiang

Re: [PATCH v2 2/4] erofs-utils: introduce build support for libcurl, openssl and libxml2 library

2025-08-01 Thread Gao Xiang
sers disable any library, it should fail. I think why it should behave as this, because libcurl openssl and libxml can be used for other use cases (e.g. oci registry support), users can always link these libs Thanks, Gao Xiang

[PATCH v4 3/3] erofs-utils: lib: implement 3-way merge sort

2025-07-31 Thread Gao Xiang
...so that only substrings need to be compared. It can still be further improved (e.g., by generating a singly linked list first); any contributions are welcome! Signed-off-by: Gao Xiang --- include/erofs/list.h | 5 ++ lib/inode.c | 111

[PATCH v3 3/3] erofs-utils: lib: implement 3-way merge sort

2025-07-30 Thread Gao Xiang
...so that only substrings need to be compared. As a follow-up, need to add a fallback to a trivial comparison and sort method when the total number of strings is small. Signed-off-by: Gao Xiang --- change since v1: - just reset step as one byte. lib/inode.c | 84

Re: [RFC 2/4] erofs-utils: introduce build support for libcurl, openssl and libxml2 library

2025-07-30 Thread Gao Xiang
*/ +/* + * Copyright (C) 2025 HUAWEI, Inc. + * http://www.huawei.com/ + * Created by Yifan Zhao + */ +#ifndef __EROFS_S3_H +#define __EROFS_S3_H + +#endif This file is empty in this patch, so it would be better to add in the following patch. Thanks, Gao Xiang

[PATCH v2 3/3] erofs-utils: lib: implement 3-way merge sort

2025-07-30 Thread Gao Xiang
...so that only substrings need to be compared. As a follow-up, need to add a fallback to a trivial sort and comparison method when the total number of strings is small. Signed-off-by: Gao Xiang --- change since v1: - get rid of unneeded `u32 count[2]`. lib/inode.c | 86

[PATCH 2/3] erofs-utils: avoid `.` dirent insertion if dot_omitted is enabled

2025-07-30 Thread Gao Xiang
It's also used for the upcoming sort optimization. Signed-off-by: Gao Xiang --- lib/inode.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/inode.c b/lib/inode.c index cbce712b..59031144 100644 --- a/lib/inode.c +++ b/lib/inode.c @@ -2

[PATCH 1/3] erofs-utils: lib: get rid of erofs_init_empty_dir()

2025-07-30 Thread Gao Xiang
... and defer insertion of `.` and `..` entries when preparing directory inodes. Signed-off-by: Gao Xiang --- include/erofs/inode.h | 1 - lib/inode.c | 52 +-- lib/rebuild.c | 4 ++-- lib/tar.c | 4 +--- 4 files changed

[PATCH 3/3] erofs-utils: lib: implement 3-way merge sort

2025-07-30 Thread Gao Xiang
...so that only substrings need to be compared. As a follow-up, need to add a fallback to a trivial sort and comparison method when the total number of strings is small. Signed-off-by: Gao Xiang --- lib/inode.c | 88 - 1 file changed, 60

Re: [PATCH] erofs: Do not select tristate symbols from bool symbols

2025-07-30 Thread Gao Xiang
ortunately Kconfig cannot be changed easily to detect this automatically, as it cannot distinguish between a "bool" symbol representing a configurable option in a module, and a driver that cannot be a module. --- Thanks, it looks good to me, will upstream in this cycle: Reviewed-by: Gao

Re: [PATCH v2] erofs: Fallback to normal access if DAX is not supported on extra device

2025-07-30 Thread Gao Xiang
namespace not allowed"); I'm fine with either way, but if we follow ext2/ext4, erofs_err() is needed too although I don't think the fallback should be identified as errors... Thanks, Gao Xiang

Re: [PATCH v1] erofs: Fallback to normal access if DAX is not supported on extra device

2025-07-28 Thread Gao Xiang
X_ALWAYS) && sbi->blkszbits != PAGE_SHIFT) { +    errorfc(fc, "unsupported blocksize for DAX"); How about using the info log? Can we consider using infofc in this case? I think you suggestion sounds better, but how about sending to the original author? Thanks, Gao Xiang

Re: [PATCH v2] erofs: Fallback to normal access if DAX is not supported on extra device

2025-07-27 Thread Gao Xiang
data on that device will be inaccessible. Signed-off-by: Yuezhang Mo Reviewed-by: Friendy Su Reviewed-by: Jacky Cao Reviewed-by: Daniel Palmer Reviewed-by: Gao Xiang Thanks, Gao Xiang

[GIT PULL] erofs updates for 6.17-rc1

2025-07-27 Thread Gao Xiang
merge conflict is observed. [1] https://issues.redhat.com/browse/RHEL-75783 Thanks, Gao Xiang The following changes since commit 89be9a83ccf1f88522317ce02f854f30d6115c41: Linux 6.16-rc7 (2025-07-20 15:18:33 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kerne

Re: [PATCH v1] erofs: Fallback to normal access if DAX is not supported on extra device

2025-07-27 Thread Gao Xiang
the following char of `(` in the line above. Also if it's possible, please remove the unnecessary comment ("/* handle multiple devices */") above erofs_scan_devices() together since: - it was obvious and it might be not inaccurrate; - it now handles some primary device stuff too. Thanks, Gao XIang

[PATCH 6.1.y 5/5] erofs: address D-cache aliasing

2025-07-22 Thread Gao Xiang
nux.alibaba.com Signed-off-by: Gao Xiang --- fs/erofs/decompressor.c | 6 ++ fs/erofs/zdata.c| 32 +++- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c index b1746215efe6..e524c0b432f3 100644

[PATCH 6.1.y 4/5] erofs: simplify z_erofs_transform_plain()

2025-07-22 Thread Gao Xiang
ng in practice. Signed-off-by: Gao Xiang Reviewed-by: Yue Hu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20230627161240.331-2-hsiang...@linux.alibaba.com Signed-off-by: Gao Xiang --- fs/erofs/decompressor.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --

[PATCH 6.1.y 2/5] erofs: sunset erofs_dbg()

2025-07-22 Thread Gao Xiang
commit 10656f9ca60ed85f4cfc06bcbe1f240ee310fa8c upstream. Such debug messages are rarely used now. Let's get rid of these, and revert locally if they are needed for debugging. Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20230414083027.12307-1-h

[PATCH 6.1.y 1/5] erofs: get rid of debug_one_dentry()

2025-07-22 Thread Gao Xiang
ue Hu Reviewed-by: Jingbo Xu Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- fs/erofs/dir.c | 17 - 1 file changed, 17 deletions(-) diff --git a/fs/erofs/dir.c b/fs/erofs/dir.c index 966a88cc529e..963bbed0b699 100644 --- a/fs/erofs/dir.c +++ b/fs/erofs/dir.c @@ -6,21

[PATCH 6.1.y 3/5] erofs: drop z_erofs_page_mark_eio()

2025-07-22 Thread Gao Xiang
commit 9a05c6a8bc26138d34e87b39e6a815603bc2a66c upstream. It can be folded into z_erofs_onlinepage_endio() to simplify the code. Reviewed-by: Yue Hu Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20230817082813.81180-5-hsiang...@linux.alibaba.com --- fs/erofs

[PATCH 6.1.y 0/5] erofs: backport for `erofs: address D-cache aliasing`

2025-07-22 Thread Gao Xiang
6.6.y fix: https://lore.kernel.org/r/20250722094449.2950654-1-hsiang...@linux.alibaba.com Hi Jan & Stefan, Please help confirm this 6.1 fix backport if possible too. Thanks, Gao Xiang Gao Xiang (5): erofs: get rid of debug_one_dentry() erofs: sunset erofs_dbg() erofs:

[PATCH 6.6.y] erofs: address D-cache aliasing

2025-07-22 Thread Gao Xiang
nux.alibaba.com Signed-off-by: Gao Xiang --- Hi Jan & Stefan, Please help confirm this 6.6 fix backport if possible. Thanks, Gao Xiang fs/erofs/decompressor.c | 6 ++ fs/erofs/zdata.c| 32 +++- 2 files changed, 21 insertions(+), 17 deletions(-) di

Re: linux-next: Tree for Jul 21 (fs/erofs/*.c)

2025-07-21 Thread Gao Xiang
port. I checked this just now. This warning is due to another helper erofs_inode_in_metabox(). I've fixed it up and just push it out but not sure if it will catch up with the today's next (20250722). Thanks, Gao Xiang

[PATCH v7 2/2] erofs: implement metadata compression

2025-07-21 Thread Gao Xiang
-disk NIDs because of non-LTS 32-bit application compatibility. Co-developed-by: Gao Xiang Signed-off-by: Bo Liu Acked-by: Chao Yu Signed-off-by: Gao Xiang --- change since v6: - fix i386 build warning: https://lore.kernel.org/r/b555f01c-4e9e-4b42-aa5a-2d35ef9c1...@infradead.org

Re: Compressed files & the page cache

2025-07-21 Thread Gao Xiang
On 2025/7/21 19:36, Qu Wenruo wrote: 在 2025/7/21 19:55, Jan Kara 写道: On Mon 21-07-25 11:14:02, Gao Xiang wrote: Hi Barry, On 2025/7/21 09:02, Barry Song wrote: On Wed, Jul 16, 2025 at 8:28 AM Gao Xiang wrote: [...] Given the difficulty of allocating large folios, it's always a

Re: Compressed files & the page cache

2025-07-21 Thread Gao Xiang
Hi Jan, On 2025/7/21 18:25, Jan Kara wrote: On Mon 21-07-25 11:14:02, Gao Xiang wrote: Hi Barry, On 2025/7/21 09:02, Barry Song wrote: On Wed, Jul 16, 2025 at 8:28 AM Gao Xiang wrote: ... ... high-order folios can cause side effects on embedded devices like routers and IoT devices

Re: Compressed files & the page cache

2025-07-20 Thread Gao Xiang
Hi Barry, On 2025/7/21 09:02, Barry Song wrote: On Wed, Jul 16, 2025 at 8:28 AM Gao Xiang wrote: ... ... high-order folios can cause side effects on embedded devices like routers and IoT devices, which still have MiBs of memory (and I believe this won't change due to their use

Re: [PATCH v4] erofs: support to readahead dirent blocks in erofs_readdir()

2025-07-20 Thread Gao Xiang
n large directory */ + if (ra_pages) { + pgoff_t idx = DIV_ROUND_UP(ctx->pos, PAGE_SIZE); Can we use DIV_ROUND_UP_POW2 here too? If it's okay, I will update the patch manually when applied. Otherwise it looks good to me, Reviewed-by: Gao Xiang Thanks, Gao Xiang

[PATCH] erofs-utils: lib: fix BFINAL judgment for kite-deflate

2025-07-18 Thread Gao Xiang
There should be enough space to generate a new DEFLATE block with an end-of-block symbol, which requires at least 10 bits for BTYPE 01. Fixes: 861037f4fc15 ("erofs-utils: add a built-in DEFLATE compressor") Signed-off-by: Gao Xiang --- lib/kite_defla

Re: [PATCH v4] erofs: fix build error with CONFIG_EROFS_FS_ZIP_ACCEL=y

2025-07-18 Thread Gao Xiang
pport DEFLATE decompression by using Intel QAT") Signed-off-by: Bo Liu Reviewed-by: Gao Xiang change since v3: - change Kconfg to select CRYPTO and CRYPTO_DEFLATE These two lines should be moved under the line ``, since it shouldn't be part of the commit message, but I'

[PATCH 06/11] erofs-utils: lib: use meta buffers for inode operations

2025-07-18 Thread Gao Xiang
Source kernel commit: c521e3ad6cc980df6f3bdd2616808ecb973af880 Signed-off-by: Gao Xiang --- lib/namei.c | 78 ++--- 1 file changed, 56 insertions(+), 22 deletions(-) diff --git a/lib/namei.c b/lib/namei.c index d6013e5c..c3ddd590 100644 --- a/lib

[PATCH 09/11] erofs-utils: formalize erofs_pread()

2025-07-17 Thread Gao Xiang
Now erofs_pread() is simply a wrapper around erofs_io_pread(), and erofs_iopen() is used to obtain a virtual file for erofs_pread(). Signed-off-by: Gao Xiang --- dump/main.c | 10 +++-- fsck/main.c | 7 +- fuse/main.c | 23

[PATCH 10/11] erofs-utils: fsck, dump: support metadata compression

2025-07-17 Thread Gao Xiang
Source kernel commit: Source kernel commit: Signed-off-by: Gao Xiang --- dump/main.c | 10 +- fsck/main.c | 25 ++- include/erofs/internal.h | 19

[PATCH 07/11] erofs-utils: lib: use meta buffers for zmap operations

2025-07-17 Thread Gao Xiang
Source kernel commit: 09c543798c3cde19aae575a0f76d5fc7c130ff18 Signed-off-by: Gao Xiang --- dump/main.c | 2 +- fsck/main.c | 2 +- include/erofs/internal.h | 3 +- lib/data.c | 4 +- lib/fragments.c | 4 +- lib/rebuild.c| 2

[PATCH 05/11] erofs-utils: lib: introduce meta buffer operations

2025-07-17 Thread Gao Xiang
Source kernel commit: fdf80a4793021c2f27953b3075f401a497519ba4 Source kernel commit: 469ad583c1293f5d9f45183050b3beeb4a8c3475 Source kernel commit: e09815446d6944fc5590a6e5f15dd51697202441 Signed-off-by: Gao Xiang --- include/erofs/internal.h | 14 ++ lib/data.c | 36

[PATCH 01/11] erofs-utils: mkfs: don't generate encoded extents for ztailpacking

2025-07-17 Thread Gao Xiang
.. Need more library work for ztailpacking. Fixes: f978245e9da8 ("erofs-utils: support encoded extents") Signed-off-by: Gao Xiang --- lib/compress.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/compress.c b/lib/compress.c index a57bb6a3..22fb5d6d 100644

[PATCH 11/11] erofs-utils: introduce metadata compression [metabox]

2025-07-17 Thread Gao Xiang
save metadata space: $ mkfs.erofs -zlzma -C1048576 -m4096:lz4hc,12 foo.erofs foo Or $ mkfs.erofs -zlzma:lz4hc,12 -C1048576 -m4096:1 foo.erofs foo will compress metadata in 4096-byte pclusters using LZ4HC level 12. Signed-off-by: Gao Xiang --- include/erofs/blobchunk.h | 3 +- include

[PATCH 02/11] erofs-utils: lib: consolidate erofs_iflush()

2025-07-17 Thread Gao Xiang
.. Avoid erofs_dev_write() and use the bdev virtual file instead. Signed-off-by: Gao Xiang --- include/erofs/internal.h | 3 +- lib/blobchunk.c | 6 ++-- lib/inode.c | 67 +++- lib/super.c | 1 - 4 files changed, 35

[PATCH 08/11] erofs-utils: lib: use meta buffers for xattr operations

2025-07-17 Thread Gao Xiang
Source kernel commit: bb88e8da00253bea0e7f0f4cdfd7910572d7799f Signed-off-by: Gao Xiang --- lib/xattr.c | 92 + 1 file changed, 44 insertions(+), 48 deletions(-) diff --git a/lib/xattr.c b/lib/xattr.c index 6711dcc1..a2ef8d20 100644 --- a/lib

[PATCH 03/11] erofs-utils: use virtual file interface for the buffer manager

2025-07-17 Thread Gao Xiang
In order to prepare for the upcoming metadata compression. Signed-off-by: Gao Xiang --- include/erofs/cache.h| 9 + include/erofs/internal.h | 6 -- include/erofs/io.h | 2 +- lib/cache.c | 12 +--- lib/io.c | 6 +++--- mkfs/main.c

[PATCH 04/11] erofs-utils: lib: change argument order of erofs_io_pread()

2025-07-17 Thread Gao Xiang
To match pread(), swap the order of `len` and `pos`. Signed-off-by: Gao Xiang --- include/erofs/io.h | 4 ++-- lib/io.c | 8 lib/super.c| 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/erofs/io.h b/include/erofs/io.h index 14d6e45f

[PATCH v6 2/2] erofs: implement metadata compression

2025-07-17 Thread Gao Xiang
-disk NIDs because of non-LTS 32-bit application compatibility. Co-developed-by: Gao Xiang Signed-off-by: Bo Liu Signed-off-by: Gao Xiang --- change since v5: - adjust inode numbers for metadata-compressed inodes in order to keep compatibility with non-LTS applications. Documentation/ABI

Re: [PATCH v3] erofs: support to readahead dirent blocks in erofs_readdir()

2025-07-17 Thread Gao Xiang
On 2025/7/18 09:52, Chao Yu wrote: Hi Xiang, On 2025/7/17 16:26, Gao Xiang wrote: Hi Chao, On 2025/7/14 17:39, Chao Yu wrote: This patch supports to readahead more blocks in erofs_readdir(), it can enhance readdir performance in large direcotry. readdir test in a large directory which

Re: [PATCH v3] erofs: support to readahead dirent blocks in erofs_readdir()

2025-07-17 Thread Gao Xiang
LONG - 1) #define EROFS_I_BL_Z_BIT (BITS_PER_LONG - 2) +/* default readahead size of directory */ /* default readahead size of directories */ Otherwise it looks good to me. Thanks, Gao Xiang +#define EROFS_DIR_RA_BYTES 16384

[PATCH v5 2/2] erofs: implement metadata compression

2025-07-17 Thread Gao Xiang
From: Bo Liu Thanks to the meta buffer infrastructure, metadata-compressed inodes are just read from the metabox inode instead of the blockdevice (or backing file) inode. The same is true for shared extended attributes. Co-developed-by: Gao Xiang Signed-off-by: Bo Liu Signed-off-by: Gao

[PATCH v5 1/2] erofs: add on-disk definition for metadata compression

2025-07-17 Thread Gao Xiang
inode` if COMPAT_SHARED_EA_IN_METABOX is set. [1] https://issues.redhat.com/browse/RHEL-75783 Signed-off-by: Gao Xiang --- fs/erofs/erofs_fs.h | 13 ++--- fs/erofs/internal.h | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/fs/erofs/erofs_fs.h b/fs/erofs/erofs_

[PATCH v5 0/3] erofs: support metadata compression

2025-07-17 Thread Gao Xiang
4 (4636KiB) ___| [ Note: directory data is still left uncompressed by `mkfs.erofs` so the final image sizes can be further smaller. Directory data is just like regular data, which only needs some userspace work so let's address it later. ] Thanks, Gao Xiang v3/4: https://

Re: [PATCH v3] erofs: fix build error with CONFIG_EROFS_FS_ZIP_ACCEL=y

2025-07-16 Thread Gao Xiang
pport DEFLATE decompression by using Intel QAT") Signed-off-by: Bo Liu Reviewed-by: Gao Xiang Thanks, Gao Xiang

[PATCH] erofs: remove ENOATTR definition

2025-07-16 Thread Gao Xiang
ENOATTR is not defined in Linux; use ENODATA instead. Signed-off-by: Gao Xiang --- fs/erofs/xattr.c | 32 fs/erofs/xattr.h | 3 --- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c index 9cf84717a92e

Re: Compressed files & the page cache

2025-07-16 Thread Gao Xiang
much difference to avoid memcpy() in the whole I/O path (because Huffman tree and FSE table are already slow), but lz4 matters. Thanks, Gao Xiang

Re: [PATCH v2] erofs: fix build error with CONFIG_EROFS_FS_ZIP_ACCEL=y

2025-07-16 Thread Gao Xiang
testing, I think we should rely on CRYPTO_ACOMP or CRYPTO_ACOMP2 instead. Otherwise it will still fails. Thanks, Gao Xiang

Re: [PATCH] erofs: fix build error with CONFIG_EROFS_FS_ZIP_ACCEL=y

2025-07-16 Thread Gao Xiang
: crypto_alloc_acomp referenced by decompressor_crypto.c fs/erofs/decompressor_crypto.o:(z_erofs_crypto_enable_engine) in archive vmlinux.a Could you add a `Fixes` tag for this? Signed-off-by: Bo Liu Thanks, let me reconfirm if if can resolved the issue. Thanks, Gao Xiang

[PATCH v4 2/2] erofs: implement metadata compression

2025-07-16 Thread Gao Xiang
From: Bo Liu Thanks to the meta buffer infrastructure, metadata-compressed inodes are just read from the metabox inode instead of the blockdevice (or backing file) inode. The same is true for shared extended attributes. Co-developed-by: Gao Xiang Signed-off-by: Bo Liu Signed-off-by: Gao

[PATCH v3 0/2] erofs: support metadata compression

2025-07-16 Thread Gao Xiang
__ `-m4096` __|___ 377856000 ( 361MiB) ___| |_|_ `-m4096` (lz4hc,12) _|___ 377942016 ( 361MiB) ___| Thanks, Gao Xiang v2: https://lore.kernel.org/r/20250711094004.2488-1-liub...@inspur.com Changes since v2: - refine the ondisk format and implementation. Bo Liu (1): erofs: implemen

[PATCH v3 2/2] erofs: implement metadata compression

2025-07-16 Thread Gao Xiang
From: Bo Liu Thanks to the meta buffer infrastructure, metadata-compressed inodes are just read from the metabox inode instead of the blockdevice (or backing file) inode. The same is true for shared extended attributes. Co-developed-by: Gao Xiang Signed-off-by: Bo Liu Signed-off-by: Gao

[PATCH v3 1/2] erofs: add on-disk definition for metadata compression

2025-07-16 Thread Gao Xiang
inode` if COMPAT_SHARED_EA_IN_METABOX is set. [1] https://issues.redhat.com/browse/RHEL-75783 Signed-off-by: Gao Xiang --- fs/erofs/erofs_fs.h | 13 ++--- fs/erofs/internal.h | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/fs/erofs/erofs_fs.h b/fs/erofs/erofs_

[PATCH 2/3] erofs-utils: lib: consolidate erofs_iflush()

2025-07-16 Thread Gao Xiang
.. Avoid erofs_dev_write() and use the bdev virtual file instead. Signed-off-by: Gao Xiang --- include/erofs/internal.h | 3 +- lib/blobchunk.c | 6 ++-- lib/inode.c | 67 +++- lib/super.c | 1 - 4 files changed, 35

[PATCH 1/3] erofs-utils: mkfs: don't generate encoded extents for ztailpacking

2025-07-16 Thread Gao Xiang
.. Need more library work for ztailpacking. Fixes: f978245e9da8 ("erofs-utils: support encoded extents") Signed-off-by: Gao Xiang --- lib/compress.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/compress.c b/lib/compress.c index a57bb6a3..22fb5d6d 100644

[PATCH 3/3] erofs-utils: use virtual file interface for the buffer manager

2025-07-16 Thread Gao Xiang
In order to prepare for the upcoming metadata compression. Signed-off-by: Gao Xiang --- include/erofs/cache.h| 9 + include/erofs/internal.h | 6 -- include/erofs/io.h | 2 +- lib/cache.c | 12 +--- lib/io.c | 6 +++--- mkfs/main.c

[PATCH] erofs: refine erofs_iomap_begin()

2025-07-16 Thread Gao Xiang
- Avoid calling erofs_map_dev() for unmapped extents; - Assign `iomap->addr` for inline extents too (since they have physical location). Signed-off-by: Gao Xiang --- fs/erofs/data.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/fs/er

[PATCH v2 2/2] erofs: unify meta buffers in z_erofs_fill_inode()

2025-07-15 Thread Gao Xiang
There is no need to keep additional local metabufs since we already have one in `struct erofs_map_blocks`. This was actually a leftover when applying meta buffers to zmap operations, see commit 09c543798c3c ("erofs: use meta buffers for zmap operations"). Signed-off-by: Gao Xiang ---

Re: Compressed files & the page cache

2025-07-15 Thread Gao Xiang
On 2025/7/16 12:54, Qu Wenruo wrote: 在 2025/7/16 10:46, Gao Xiang 写道: ... There's some discrepancy between filesystems whether you need scratch space for decompression.  Some filesystems read the compressed data into the pagecache and decompress in-place, while other filesystems

Re: Compressed files & the page cache

2025-07-15 Thread Gao Xiang
fastest LZ77-family algorithms like LZ4, LZO just operates on virtual consecutive buffers and treat the decompressed buffer as LZ77 sliding window. So that either you need to allocate another temporary consecutive buffer (I believe that is what btrfs does) or use vmap() approach, EROFS is interes

Re: Compressed files & the page cache

2025-07-15 Thread Gao Xiang
On 2025/7/16 07:32, Gao Xiang wrote: Hi Matthew, On 2025/7/16 04:40, Matthew Wilcox wrote: I've started looking at how the page cache can help filesystems handle compressed data better.  Feedback would be appreciated!  I'll probably say a few things which are obvious to anyone who

  1   2   3   4   5   6   7   8   9   10   >