[PATCH v2] erofs: reliably distinguish block based and fscache mode

2024-04-16 Thread Baokun Li via Linux-erofs
When erofs_kill_sb() is called in block dev based mode, s_bdev may not have been initialised yet, and if CONFIG_EROFS_FS_ONDEMAND is enabled, it will be mistaken for fscache mode, and then attempt to free an anon_dev that has never been allocated, triggering the following warning:

Re: [PATCH] erofs: set SB_NODEV sb_flags when mounting with fsid

2024-04-16 Thread Baokun Li via Linux-erofs
On 2024/4/17 11:11, Gao Xiang wrote: On Wed, Apr 17, 2024 at 10:59:53AM +0800, Baokun Li wrote: On 2024/4/16 22:49, Gao Xiang wrote: On Tue, Apr 16, 2024 at 02:35:08PM +0200, Christian Brauner wrote: I'm not sure how to resolve it in EROFS itself, anyway... Instead of allocating the erofs_sb_

Re: [PATCH] erofs: set SB_NODEV sb_flags when mounting with fsid

2024-04-16 Thread Gao Xiang
On Wed, Apr 17, 2024 at 10:59:53AM +0800, Baokun Li wrote: > On 2024/4/16 22:49, Gao Xiang wrote: > > On Tue, Apr 16, 2024 at 02:35:08PM +0200, Christian Brauner wrote: > > > > > I'm not sure how to resolve it in EROFS itself, anyway... > > > Instead of allocating the erofs_sb_info in fill_super()

Re: [PATCH] erofs: set SB_NODEV sb_flags when mounting with fsid

2024-04-16 Thread Baokun Li via Linux-erofs
On 2024/4/16 22:49, Gao Xiang wrote: On Tue, Apr 16, 2024 at 02:35:08PM +0200, Christian Brauner wrote: I'm not sure how to resolve it in EROFS itself, anyway... Instead of allocating the erofs_sb_info in fill_super() allocate it during erofs_get_tree() and then you can ensure that you always h

Re: [PATCH 11/26] 9p: Use alternative invalidation to using launder_folio

2024-04-16 Thread David Howells
Jeff Layton wrote: > Shouldn't this include a call to filemap_invalidate_inode? Is just > removing launder_folio enough to do this? Good point. netfs_unbuffered_write_iter() calls kiocb_invalidate_pages() - which uses invalidate_inode_pages2_range() to discard the pagecache. It should probably

Re: [PATCH 03/26] netfs: Update i_blocks when write committed to pagecache

2024-04-16 Thread David Howells
Jeff Layton wrote: > > Update i_blocks when i_size is updated when we finish making a write to the > > pagecache to reflect the amount of space we think will be consumed. > > > > Umm ok, but why? I get that the i_size and i_blocks would be out of sync > until we get back new attrs from the serv

Re: [PATCH 01/26] cifs: Fix duplicate fscache cookie warnings

2024-04-16 Thread David Howells
Steve French wrote: > Should this be merged independently (and sooner? in rc5?) It's already upstream through the cifs tree and I've dropped it from my branch. David

Very Urgent Reply!!!!

2024-04-16 Thread Dip Paul Enes
Attention Sir/Madam, I hope this message finds you well. I am writing to inform you of some exciting news regarding the delivery of your consignment. Diplomat James Morgan, who has been mandated by our company to ensure the safe and prompt delivery of your consignment, has just arrived in your

Re: [PATCH] fs/erofs: add DEFLATE algorithm support

2024-04-16 Thread Gao Xiang
Hi Jianan, On Sun, Apr 14, 2024 at 11:04:14PM +0800, Jianan Huang wrote: > 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

Re: [PATCH 4/8] erofs-utils: rearrange several fields for multi-threaded mkfs

2024-04-16 Thread Gao Xiang
On Tue, Apr 16, 2024 at 07:55:05PM +0800, Yifan Zhao wrote: > > On 4/16/24 4:04 PM, Gao Xiang wrote: > > From: Gao Xiang > > > > They should be located in `struct z_erofs_compress_ictx`. > > > > Signed-off-by: Gao Xiang > > --- > > lib/compress.c | 55

Re: [PATCH 2/8] erofs-utils: lib: prepare for later deferred work

2024-04-16 Thread Gao Xiang
Hi Yifan, On Tue, Apr 16, 2024 at 07:58:30PM +0800, Yifan Zhao wrote: > > On 4/16/24 4:04 PM, Gao Xiang wrote: > > From: Gao Xiang > > > > Split out ordered metadata operations and add the following helpers: > > > > - erofs_mkfs_jobfn() > > > > - erofs_mkfs_go() > > > > to handle these m

Re: [PATCH] erofs: set SB_NODEV sb_flags when mounting with fsid

2024-04-16 Thread Gao Xiang
On Tue, Apr 16, 2024 at 02:35:08PM +0200, Christian Brauner wrote: > > > I'm not sure how to resolve it in EROFS itself, anyway... > > Instead of allocating the erofs_sb_info in fill_super() allocate it > during erofs_get_tree() and then you can ensure that you always have the > info you need avai

Re: [PATCH 8/8] erofs-utils: mkfs: enable inter-file multi-threaded compression

2024-04-16 Thread Yifan Zhao
On 4/16/24 4:04 PM, Gao Xiang wrote: From: Gao Xiang Dispatch deferred ops in another per-sb worker thread. Note that deferred ops are strictly FIFOed. Signed-off-by: Gao Xiang --- include/erofs/internal.h | 6 ++ lib/inode.c | 121 ++-

Re: [PATCH] erofs: set SB_NODEV sb_flags when mounting with fsid

2024-04-16 Thread Christian Brauner
> > I'm not sure how to resolve it in EROFS itself, anyway... Instead of allocating the erofs_sb_info in fill_super() allocate it during erofs_get_tree() and then you can ensure that you always have the info you need available during erofs_kill_sb(). See the appended (untested) patch. >From e4f586

Re: [PATCH 2/8] erofs-utils: lib: prepare for later deferred work

2024-04-16 Thread Yifan Zhao
On 4/16/24 4:04 PM, Gao Xiang wrote: From: Gao Xiang Split out ordered metadata operations and add the following helpers: - erofs_mkfs_jobfn() - erofs_mkfs_go() to handle these mkfs job items for multi-threadding support. Signed-off-by: Gao Xiang --- lib/inode.c | 68 ++

Re: [PATCH 4/8] erofs-utils: rearrange several fields for multi-threaded mkfs

2024-04-16 Thread Yifan Zhao
On 4/16/24 4:04 PM, Gao Xiang wrote: From: Gao Xiang They should be located in `struct z_erofs_compress_ictx`. Signed-off-by: Gao Xiang --- lib/compress.c | 55 -- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/lib/compress

[PATCH 7/8] erofs-utils: lib: introduce non-directory jobitem context

2024-04-16 Thread Gao Xiang
From: Gao Xiang It will describe EROFS_MKFS_JOB_NDIR defer work. Also start compression before queueing EROFS_MKFS_JOB_NDIR. Signed-off-by: Gao Xiang --- lib/inode.c | 62 +++-- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/lib

[PATCH 6/8] erofs-utils: mkfs: prepare inter-file multi-threaded compression

2024-04-16 Thread Gao Xiang
From: Yifan Zhao This patch separate compression process into two parts. Specifically, erofs_begin_compressed_file() will trigger compression. erofs_write_compressed_file() will wait for compression finish and write compressed (meta)data. Signed-off-by: Yifan Zhao Co-authored-by: Tong Xin Sig

[PATCH 4/8] erofs-utils: rearrange several fields for multi-threaded mkfs

2024-04-16 Thread Gao Xiang
From: Gao Xiang They should be located in `struct z_erofs_compress_ictx`. Signed-off-by: Gao Xiang --- lib/compress.c | 55 -- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/lib/compress.c b/lib/compress.c index a2e0d0f..72f33d2

[PATCH 8/8] erofs-utils: mkfs: enable inter-file multi-threaded compression

2024-04-16 Thread Gao Xiang
From: Gao Xiang Dispatch deferred ops in another per-sb worker thread. Note that deferred ops are strictly FIFOed. Signed-off-by: Gao Xiang --- include/erofs/internal.h | 6 ++ lib/inode.c | 121 ++- 2 files changed, 124 insertions(+), 3 dele

[PATCH 3/8] erofs-utils: lib: split out erofs_commit_compressed_file()

2024-04-16 Thread Gao Xiang
From: Gao Xiang Just split out on-disk compressed metadata commit logic. Signed-off-by: Gao Xiang --- lib/compress.c | 191 +++-- 1 file changed, 105 insertions(+), 86 deletions(-) diff --git a/lib/compress.c b/lib/compress.c index 74c5707..a2e0d0f

[PATCH 5/8] erofs-utils: lib: split up z_erofs_mt_compress()

2024-04-16 Thread Gao Xiang
From: Gao Xiang The on-disk compressed data write will be moved into a new function erofs_mt_write_compressed_file(). Signed-off-by: Gao Xiang --- lib/compress.c | 172 - 1 file changed, 99 insertions(+), 73 deletions(-) diff --git a/lib/compres

[PATCH 2/8] erofs-utils: lib: prepare for later deferred work

2024-04-16 Thread Gao Xiang
From: Gao Xiang Split out ordered metadata operations and add the following helpers: - erofs_mkfs_jobfn() - erofs_mkfs_go() to handle these mkfs job items for multi-threadding support. Signed-off-by: Gao Xiang --- lib/inode.c | 68 + 1 f

[PATCH 1/8] erofs-utils: use erofs_atomic_t for inode->i_count

2024-04-16 Thread Gao Xiang
From: Gao Xiang Since it can be touched for more than one thread if multi-threading is enabled. Signed-off-by: Gao Xiang --- include/erofs/atomic.h | 10 ++ include/erofs/inode.h| 2 +- include/erofs/internal.h | 3 ++- lib/inode.c | 5 +++-- 4 files changed, 16 i