Re: [PATCH v2] erofs-utils: add missing block counting

2024-04-24 Thread Gao Xiang
On 2024/4/24 13:59, Noboru Asai wrote: Add missing block counting when the data to be inlined is not inlined. --- v2: - move from erofs_write_tail_end() to erofs_prepare_tail_block() Signed-off-by: Noboru Asai Reviewed-by: Gao Xiang Thanks, Gao Xiang

Re: [PATCH 5/5] cachefiles: add missing lock protection when polling

2024-04-24 Thread Baokun Li
Hi Xiang, On 2024/4/24 12:29, Gao Xiang wrote: Hi Baokun, On 2024/4/24 11:34, libao...@huaweicloud.com wrote: From: Jingbo Xu Add missing lock protection in poll routine when iterating xarray, otherwise: Even with RCU read lock held, only the slot of the radix tree is ensured to be pinned

Re: [PATCH v2] erofs-utils: fsck: extract chunk-based file with hole correctly

2024-04-24 Thread Gao Xiang
On Mon, Apr 22, 2024 at 07:31:32PM +0800, Yifan Zhao wrote: > Currently fsck skips file extraction if it finds that EROFS_MAP_MAPPED > is unset, which is not the case for chunk-based files with hole. This > patch handles the corner case correctly. > > Signed-off-by: Yifan Zhao I will apply the

[PATCH v2] erofs-utils: add missing block counting

2024-04-24 Thread Noboru Asai
Add missing block counting when the data to be inlined is not inlined. --- v2: - move from erofs_write_tail_end() to erofs_prepare_tail_block() Signed-off-by: Noboru Asai --- lib/inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/inode.c b/lib/inode.c index cf22bbe..9aba69d 100644

Re: Trying to work with the tests

2024-04-24 Thread Gao Xiang
On 2024/4/24 17:47, Ian Kent wrote: On 23/4/24 18:34, Gao Xiang wrote: Hi Ian, On 2024/4/22 21:10, Ian Kent wrote: On 22/4/24 17:12, Gao Xiang wrote: Hi Ian, (+Cc Jingbo here). On 2024/4/22 16:31, Ian Kent wrote: I'm new to the list so Hi to all, I'm working with a heavily patched

Re: [PATCH v2] erofs-utils: add missing block counting

2024-04-24 Thread Gao Xiang
On Wed, Apr 24, 2024 at 02:15:58PM +0800, Gao Xiang wrote: > > > On 2024/4/24 13:59, Noboru Asai wrote: > > Add missing block counting when the data to be inlined is not inlined. > > > > --- > > v2: > > - move from erofs_write_tail_end() to erofs_prepare_tail_block() > > > > Signed-off-by:

Re: Trying to work with the tests

2024-04-24 Thread Ian Kent
On 24/4/24 17:47, Ian Kent wrote: On 23/4/24 18:34, Gao Xiang wrote: Hi Ian, On 2024/4/22 21:10, Ian Kent wrote: On 22/4/24 17:12, Gao Xiang wrote: Hi Ian, (+Cc Jingbo here). On 2024/4/22 16:31, Ian Kent wrote: I'm new to the list so Hi to all, I'm working with a heavily patched 5.14

Re: [PATCH 03/12] cachefiles: fix slab-use-after-free in cachefiles_ondemand_get_fd()

2024-04-24 Thread Jia Zhu via Linux-erofs
在 2024/4/24 11:39, libao...@huaweicloud.com 写道: From: Baokun Li We got the following issue in a fuzz test of randomly issuing the restore command: == BUG: KASAN: slab-use-after-free in

Re: [PATCH -next] erofs: modify the error message when prepare_ondemand_read failed

2024-04-24 Thread Jingbo Xu
On 4/24/24 4:42 PM, Hongbo Li wrote: > When prepare_ondemand_read failed, wrong error message is printed. > The prepare_read is also implemented in cachefiles, so we amend it. > > Reviewed-by: Gao Xiang > Signed-off-by: Hongbo Li > --- > fs/erofs/fscache.c | 2 +- > 1 file changed, 1

Re: Trying to work with the tests

2024-04-24 Thread Ian Kent
On 23/4/24 18:34, Gao Xiang wrote: Hi Ian, On 2024/4/22 21:10, Ian Kent wrote: On 22/4/24 17:12, Gao Xiang wrote: Hi Ian, (+Cc Jingbo here). On 2024/4/22 16:31, Ian Kent wrote: I'm new to the list so Hi to all, I'm working with a heavily patched 5.14 kernel and I've gathered together

Re: Trying to work with the tests

2024-04-24 Thread Gao Xiang
On 2024/4/24 18:37, Ian Kent wrote: On 24/4/24 17:47, Ian Kent wrote: On 23/4/24 18:34, Gao Xiang wrote: Hi Ian, On 2024/4/22 21:10, Ian Kent wrote: On 22/4/24 17:12, Gao Xiang wrote: Hi Ian, (+Cc Jingbo here). On 2024/4/22 16:31, Ian Kent wrote: I'm new to the list so Hi to all,

Re: [PATCH 03/12] cachefiles: fix slab-use-after-free in cachefiles_ondemand_get_fd()

2024-04-24 Thread Baokun Li
Hi Jia, On 2024/4/24 22:55, Jia Zhu wrote: 在 2024/4/24 11:39, libao...@huaweicloud.com 写道: From: Baokun Li We got the following issue in a fuzz test of randomly issuing the restore command: == BUG: KASAN:

Re: [External] [PATCH 04/12] cachefiles: fix slab-use-after-free in cachefiles_ondemand_daemon_read()

2024-04-24 Thread Jia Zhu via Linux-erofs
在 2024/4/24 11:39, libao...@huaweicloud.com 写道: From: Baokun Li We got the following issue in a fuzz test of randomly issuing the restore command: == BUG: KASAN: slab-use-after-free in

Re: [PATCH 01/12] cachefiles: remove request from xarry during flush requests

2024-04-24 Thread Jia Zhu via Linux-erofs
在 2024/4/24 11:39, libao...@huaweicloud.com 写道: From: Baokun Li This prevents concurrency from causing access to a freed req. Signed-off-by: Baokun Li Reviewed-by: Jia Zhu --- fs/cachefiles/daemon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/cachefiles/daemon.c

Re: [PATCH 02/12] cachefiles: remove err_put_fd tag in cachefiles_ondemand_daemon_read()

2024-04-24 Thread Jia Zhu via Linux-erofs
在 2024/4/24 11:39, libao...@huaweicloud.com 写道: From: Baokun Li The err_put_fd tag is only used once, so remove it to make the code more readable. Signed-off-by: Baokun Li Reviewed-by: Jia Zhu --- fs/cachefiles/ondemand.c | 7 +++ 1 file changed, 3 insertions(+), 4

Re: [PATCH v2] erofs-utils: add missing block counting

2024-04-24 Thread Noboru Asai
Hi Gao, Oh, sorry. I knew to access i_blkaddr on uncompressed file, but it didn't occur on the file system for testing, so I overlooked it. I needed to be careful. 2024年4月24日(水) 19:38 Gao Xiang : > > On Wed, Apr 24, 2024 at 02:15:58PM +0800, Gao Xiang wrote: > > > > > > On 2024/4/24 13:59,

Re: [PATCH 03/12] cachefiles: fix slab-use-after-free in cachefiles_ondemand_get_fd()

2024-04-24 Thread Jia Zhu via Linux-erofs
在 2024/4/24 11:39, libao...@huaweicloud.com 写道: From: Baokun Li We got the following issue in a fuzz test of randomly issuing the restore command: == BUG: KASAN: slab-use-after-free in

Re: [PATCH 10/12] cachefiles: Set object to close if ondemand_id < 0 in copen

2024-04-24 Thread Jia Zhu via Linux-erofs
在 2024/4/24 11:39, libao...@huaweicloud.com 写道: From: Zizhi Wo If copen is maliciously called in the user mode, it may delete the request corresponding to the random id. And the request may have not been read yet. Note that when the object is set to reopen, the open request will be done

Re: [PATCH 12/12] cachefiles: make on-demand read killable

2024-04-24 Thread Jia Zhu via Linux-erofs
在 2024/4/24 11:39, libao...@huaweicloud.com 写道: From: Baokun Li Replacing wait_for_completion() with wait_for_completion_killable() in cachefiles_ondemand_send_req() allows us to kill processes that might trigger a hunk_task if the daemon is abnormal. But now only CACHEFILES_OP_READ is

Re: [PATCH 3/5] cachefiles: flush ondemand_object_worker during clean object

2024-04-24 Thread Jia Zhu via Linux-erofs
Thanks for catching this. How about adding a Fixes tag. Reviewed-by: Jia Zhu 在 2024/4/24 11:34, libao...@huaweicloud.com 写道: From: Hou Tao When queuing ondemand_object_worker() to re-open the object, cachefiles_object is not pinned. The cachefiles_object may be freed when the pending read

Re: [PATCH -next] erofs: modify the error message when prepare_ondemand_read failed

2024-04-24 Thread Hongbo Li via Linux-erofs
ok, thanks! On 2024/4/24 11:29, Gao Xiang wrote: (+cc linux-erofs & LKML) On 2024/4/24 10:39, Hongbo Li wrote: When prepare_ondemand_read failed, wrong error message is printed. The prepare_read is also implemented in cachefiles, so we amend it. Signed-off-by: Hongbo Li Reviewed-by: Gao

[PATCH -next] erofs: modify the error message when prepare_ondemand_read failed

2024-04-24 Thread Hongbo Li via Linux-erofs
When prepare_ondemand_read failed, wrong error message is printed. The prepare_read is also implemented in cachefiles, so we amend it. Reviewed-by: Gao Xiang Signed-off-by: Hongbo Li --- fs/erofs/fscache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/erofs/fscache.c