[PATCH] erofs: fix memleak of node's shared xattr array

2019-02-13 Thread Sheng Yong
If it fails to read a shared xattr page, the node's shared xattr array is not freed. The next time the node's xattr is accessed, the previously allocated array is leaked. Signed-off-by: Sheng Yong --- drivers/staging/erofs/xattr.c | 5 - 1 file changed, 4 insertions(+), 1 deletio

[PATCH v2] staging: erofs: fix memleak of inode's shared xattr array

2019-02-13 Thread Sheng Yong
If it fails to read a shared xattr page, the inode's shared xattr array is not freed. The next time the inode's xattr is accessed, the previously allocated array is leaked. Signed-off-by: Sheng Yong --- v2: * s/node/inode in commit message * add prefix `staging:' to the subje

[PATCH v2] erofs-utils: fuse: set d_type for readdir

2022-08-07 Thread Sheng Yong
From: Sheng Yong Set inode mode for libfuse readdir filler so that readdir count get correct d_type. Signed-off-by: Sheng Yong --- fuse/main.c | 5 - include/erofs/inode.h | 1 + lib/inode.c | 19 +++ 3 files changed, 24 insertions(+), 1 deletion

[PATCH v2 1/2] erofs: set error to bio if file-backed IO fails

2025-04-05 Thread Sheng Yong
From: Sheng Yong If a file-backed IO fails before submitting the bio to the lower filesystem, an error is returned, but the bio->bi_status is not marked as an error. However, the error information should be passed to the end_io handler. Otherwise, the IO request will be treated as success

[PATCH v4 1/2] erofs: set error to bio if file-backed IO fails

2025-04-08 Thread Sheng Yong
From: Sheng Yong If a file-backed IO fails before submitting the bio to the lower filesystem, an error is returned, but the bio->bi_status is not marked as an error. However, the error information should be passed to the end_io handler. Otherwise, the IO request will be treated as success

[PATCH v3 1/2] erofs: set error to bio if file-backed IO fails

2025-04-07 Thread Sheng Yong
From: Sheng Yong If a file-backed IO fails before submitting the bio to the lower filesystem, an error is returned, but the bio->bi_status is not marked as an error. However, the error information should be passed to the end_io handler. Otherwise, the IO request will be treated as success

[PATCH v3 2/2] erofs: add 'offset' mount option for file-backed & bdev-based mounts

2025-04-07 Thread Sheng Yong
From: Sheng Yong When attempting to use an archive file, such as APEX on android, as a file-backed mount source, it fails because EROFS image within the archive file does not start at offset 0. As a result, a loop device is still needed to attach the image file at an appropriate offset first

[PATCH v4 2/2] erofs: add 'fsoffset' mount option for file-backed & bdev-based mounts

2025-04-08 Thread Sheng Yong
From: Sheng Yong When attempting to use an archive file, such as APEX on android, as a file-backed mount source, it fails because EROFS image within the archive file does not start at offset 0. As a result, a loop device is still needed to attach the image file at an appropriate offset first

[PATCH v2 2/2] erofs: add 'offset' mount option for file-backed & bdev-based mounts

2025-04-04 Thread Sheng Yong
From: Sheng Yong When attempting to use an archive file, such as APEX on android, as a file-backed mount source, it fails because EROFS image within the archive file does not start at offset 0. As a result, a loop device is still needed to attach the image file at an appropriate offset first

[RFC PATCH] erofs: add start offset for file-backed mount

2025-03-23 Thread Sheng Yong
From: Sheng Yong When attempting to use an archive file, such as APEX on android, as a file-backed mount source, it fails because EROFS image within the archive file does not start at offset 0. As a result, a loop device is still needed to attach the image file at an appropriate offset first

Re: [PATCH v4 2/2] erofs: add 'fsoffset' mount option for file-backed & bdev-based mounts

2025-05-08 Thread Sheng Yong
On 5/8/25 12:09, Gao Xiang wrote: Hi Yong, [...] diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index 4ac188d5d894..10656bd986bd 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h @@ -43,6 +43,7 @@ struct erofs_device_info {   char *path;   struct erofs_fscache *fscache

Re: [PATCH v4 2/2] erofs: add 'fsoffset' mount option for file-backed & bdev-based mounts

2025-05-13 Thread Sheng Yong
On 5/13/25 15:17, Gao Xiang wrote: On 2025/5/13 15:06, Hongbo Li wrote: On 2025/4/8 20:23, Sheng Yong wrote: From: Sheng Yong When attempting to use an archive file, such as APEX on android, as a file-backed mount source, it fails because EROFS image within the archive file does not

[PATCH v5 1/2] erofs: add 'fsoffset' mount option for file-backed & bdev-based mounts

2025-05-13 Thread Sheng Yong
From: Sheng Yong When attempting to use an archive file, such as APEX on android, as a file-backed mount source, it fails because EROFS image within the archive file does not start at offset 0. As a result, a loop device is still needed to attach the image file at an appropriate offset first

[PATCH 2/2] erofs: avoid using multiple devices with different type

2025-05-13 Thread Sheng Yong
From: Sheng Yong For multiple devices, both primary and extra devices should be the same type. `erofs_init_device` has already guaranteed that if the primary is a file-backed device, extra devices should also be regular files. However, if the primary is a block device while the extra device is

Re: [PATCH v5 1/2] erofs: add 'fsoffset' mount option for file-backed & bdev-based mounts

2025-05-13 Thread Sheng Yong
On 5/13/25 21:59, Hongbo Li wrote: On 2025/5/13 21:56, Hongbo Li wrote: On 2025/5/13 19:34, Sheng Yong wrote: From: Sheng Yong [...] can share storage. +fsoffset=%s    Specify image offset for file-backed or bdev- based mounts. Hi, Yong fsoffset should be formatted with %lu

Re: [PATCH v6] erofs: add 'fsoffset' mount option for file-backed & bdev-based mounts

2025-05-16 Thread Sheng Yong
Hi Xiang, On 5/16/25 17:15, Gao Xiang wrote: Hi Yong, On 2025/5/16 17:00, Sheng Yong wrote: ... diff --git a/Documentation/filesystems/erofs.rst b/Documentation/ filesystems/erofs.rst index c293f8e37468..b24cb0d5d4d6 100644 --- a/Documentation/filesystems/erofs.rst +++ b/Documentation

[PATCH v2] erofs: avoid using multiple devices with different type

2025-05-14 Thread Sheng Yong
From: Sheng Yong For multiple devices, both primary and extra devices should be the same type. `erofs_init_device` has already guaranteed that if the primary is a file-backed device, extra devices should also be regular files. However, if the primary is a block device while the extra device is

Re: [PATCH 2/2] erofs: avoid using multiple devices with different type

2025-05-14 Thread Sheng Yong
On 5/13/25 23:10, Hongbo Li wrote: [...] diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 512877d7d855..16b5b1f66584 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -165,8 +165,11 @@ static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb,  

[PATCH v6] erofs: add 'fsoffset' mount option for file-backed & bdev-based mounts

2025-05-16 Thread Sheng Yong
From: Sheng Yong When attempting to use an archive file, such as APEX on android, as a file-backed mount source, it fails because EROFS image within the archive file does not start at offset 0. As a result, a loop device is still needed to attach the image file at an appropriate offset first

[PATCH v7] erofs: add 'fsoffset' mount option to specify filesystem offset

2025-05-17 Thread Sheng Yong
From: Sheng Yong When attempting to use an archive file, such as APEX on android, as a file-backed mount source, it fails because EROFS image within the archive file does not start at offset 0. As a result, a loop or a dm device is still needed to attach the image file at an appropriate offset

Re: [xiang-erofs:dev-test 5/5] fs/erofs/super.c:659:22: error: no member named 'off' in 'struct erofs_device_info'

2025-05-18 Thread Sheng Yong
On 5/19/25 02:06, kernel test robot wrote: tree: https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git dev-test head: 7cd18799175c533c3f9b1c2b2cb6551e2a86c921 commit: 7cd18799175c533c3f9b1c2b2cb6551e2a86c921 [5/5] erofs: add 'fsoffset' mount option to specify filesystem offset conf

Re: [PATCH v7] erofs: add 'fsoffset' mount option to specify filesystem offset

2025-05-18 Thread Sheng Yong
On 5/19/25 11:54, Gao Xiang wrote: Hi Yong, On Sat, May 17, 2025 at 05:05:43PM +0800, Sheng Yong wrote: From: Sheng Yong When attempting to use an archive file, such as APEX on android, as a file-backed mount source, it fails because EROFS image within the archive file does not start at

[PATCH] erofs-utils: lib: fix sorting shared xattrs

2024-09-13 Thread Sheng Yong via Linux-erofs
string being cut by '\0'. Fixes: 5df285cf405d ("erofs-utils: lib: refactor extended attribute name prefixes") Signed-off-by: Sheng Yong --- lib/xattr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/xattr.c b/lib/xattr.c index 651657f979cc..1dbb

[RFC PATCH 0/3] erofs-utils: fuse: support get/list xattr

2022-08-03 Thread Sheng Yong via Linux-erofs
, readdir is also modified to help mkfs.erofs get the correct file type. Sheng Yong (3): erofs-utils: fuse: set d_type for readdir erofs-utils: fuse: export erofs_xattr_foreach erofs-utils: fuse: support get/list xattr fsck/main.c | 85 fuse/main.c

[RFC PATCH 1/3] erofs-utils: fuse: set d_type for readdir

2022-08-03 Thread Sheng Yong via Linux-erofs
Set inode mode for libfuse readdir filler so that readdir count get correct d_type. Signed-off-by: Sheng Yong --- fuse/main.c | 5 - include/erofs/inode.h | 1 + lib/inode.c | 19 +++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/fuse

[RFC PATCH 2/3] erofs-utils: fuse: export erofs_xattr_foreach

2022-08-03 Thread Sheng Yong via Linux-erofs
This patch exports erofs_xattr_foreach() to iterate all xattrs. Each xattr entry is handled by operations defined in `struct xattr_iter_ops'. Signed-off-by: Sheng Yong --- fsck/main.c | 83 include/erofs/xattr.h | 7 ++- lib/xattr.c

[RFC PATCH 3/3] erofs-utils: fuse: support get/list xattr

2022-08-03 Thread Sheng Yong via Linux-erofs
Add new options get and list to xattr iteration operations to support getxattr and listxattr. Signed-off-by: Sheng Yong --- fsck/main.c | 2 + fuse/main.c | 135 ++ include/erofs/xattr.h | 8 +++ lib/xattr.c | 26

Re: [RFC PATCH 1/3] erofs-utils: fuse: set d_type for readdir

2022-08-04 Thread Sheng Yong via Linux-erofs
在 2022/8/4 23:02, Gao Xiang 写道: On Thu, Aug 04, 2022 at 03:43:04AM +0800, Gao Xiang wrote: On Wed, Aug 03, 2022 at 10:22:21PM +0800, Sheng Yong wrote: Set inode mode for libfuse readdir filler so that readdir count get correct d_type. Signed-off-by: Sheng Yong Reviewed-by: Gao Xiang

Re: [RFC PATCH 2/3] erofs-utils: fuse: export erofs_xattr_foreach

2022-08-08 Thread Sheng Yong via Linux-erofs
在 2022/8/9 11:58, Gao Xiang 写道: Hi Yong, On Thu, Aug 04, 2022 at 03:46:24AM +0800, Gao Xiang wrote: On Wed, Aug 03, 2022 at 10:22:22PM +0800, Sheng Yong wrote: This patch exports erofs_xattr_foreach() to iterate all xattrs. Each xattr entry is handled by operations defined in `struct