[PATCH 3/3] erofs-utils: allow blkaddr == EROFS_NULL_ADDR for zpacking in write_compacted_indexes()

2024-04-17 Thread Noboru Asai
With ztailpacking, the value of blkaddr corresponding to the ztailpacking block in the extent list is EROFS_NULL_ADDR(-1), allow this value in write_compacted_indexes() function. Signed-off-by: Noboru Asai --- lib/compress.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 2/3] erofs-utils: skip the redundant write for ztailpacking block

2024-04-17 Thread Noboru Asai
z_erofs_merge_segment() doesn't consider the ztailpacking block in the extent list and unnecessarily writes it back to the disk. This patch fixes this issue by changing compressdblks to 0. And the value of blkaddr corresponding to the ztailpacking block in the extent list is handled in

Re: [PATCH] erofs-utils: mkfs: skip the redundant write for ztailpacking block

2024-04-17 Thread Noboru Asai
Hi Gao, I made a patch set and send it. I'm grad that this patch set help your thinking. 2024年4月18日(木) 13:58 Gao Xiang : > > Hi Noboru, > > On Thu, Apr 18, 2024 at 10:09:22AM +0900, Noboru Asai wrote: > > In this patch, the value of blkaddr in z_erofs_lcluster_index > > corresponding to the

[PATCH 1/3] erofs-utils: determine the [un]compressed data block is inline or not early

2024-04-17 Thread Noboru Asai
Introducing erofs_get_inodesize function and erofs_get_lowest_offset function, we can determine the [un]compressed data block is inline or not before executing z_erofs_merge_segment function. It enable the following, * skip the redundant write for ztailpacking block. * simplify

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

2024-04-17 Thread Jingbo Xu
On 4/18/24 11:36 AM, Baokun Li wrote: > On 2024/4/18 10:16, Jingbo Xu wrote: >> Hi Baokun, >> >> Thanks for catching this and move forward fixing this! > > Hi Jingbo, > > Thanks for your review! > >> >> On 4/17/24 2:55 PM, Baokun Li wrote: >>> When erofs_kill_sb() is called in block dev

Re: [PATCH v3] erofs-utils: lib: treat data blocks filled with 0s as a hole

2024-04-17 Thread Gao Xiang
On Wed, Apr 17, 2024 at 04:48:44PM -0700, Sandeep Dhavale wrote: > Add optimization to treat data blocks filled with 0s as a hole. > Even though diskspace savings are comparable to chunk based or dedupe, > having no block assigned saves us redundant disk IOs during read. > > To detect blocks

Re: [PATCH] erofs-utils: mkfs: skip the redundant write for ztailpacking block

2024-04-17 Thread Yifan Zhao
On 4/18/24 9:09 AM, Noboru Asai wrote: In this patch, the value of blkaddr in z_erofs_lcluster_index corresponding to the ztailpacking block in the extent list is invalid value. It looks that the linux kernel doesn't refer to this value, but what value is correct? 0 or -1 (EROFS_NULL_ADDR) or

Re: [PATCH] erofs-utils: mkfs: skip the redundant write for ztailpacking block

2024-04-17 Thread Gao Xiang
Hi Noboru, On Thu, Apr 18, 2024 at 10:09:22AM +0900, Noboru Asai wrote: > In this patch, the value of blkaddr in z_erofs_lcluster_index > corresponding to the ztailpacking block in the extent list > is invalid value. It looks that the linux kernel doesn't refer to this > value, but what value is

Re: [PATCH v3] erofs-utils: dump: print filesystem blocksize

2024-04-17 Thread Gao Xiang
On Wed, Apr 17, 2024 at 05:00:54PM -0700, Sandeep Dhavale wrote: > mkfs.erofs supports creating filesystem images with different > blocksizes. Add filesystem blocksize in super block dump so > its easier to inspect the filesystem. > > The field is added after FS magic, so the output now looks

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

2024-04-17 Thread Baokun Li via Linux-erofs
On 2024/4/18 10:16, Jingbo Xu wrote: Hi Baokun, Thanks for catching this and move forward fixing this! Hi Jingbo, Thanks for your review! On 4/17/24 2:55 PM, Baokun Li wrote: When erofs_kill_sb() is called in block dev based mode, s_bdev may not have been initialised yet, and if

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

2024-04-17 Thread Jingbo Xu
Hi Baokun, Thanks for catching this and move forward fixing this! On 4/17/24 2:55 PM, Baokun Li wrote: > 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

Re: [PATCH] erofs-utils: mkfs: skip the redundant write for ztailpacking block

2024-04-17 Thread Noboru Asai
In this patch, the value of blkaddr in z_erofs_lcluster_index corresponding to the ztailpacking block in the extent list is invalid value. It looks that the linux kernel doesn't refer to this value, but what value is correct? 0 or -1 (EROFS_NULL_ADDR) or don't care? 2024年4月17日(水) 23:43 Yifan Zhao

[PATCH v3] erofs-utils: dump: print filesystem blocksize

2024-04-17 Thread Sandeep Dhavale via Linux-erofs
mkfs.erofs supports creating filesystem images with different blocksizes. Add filesystem blocksize in super block dump so its easier to inspect the filesystem. The field is added after FS magic, so the output now looks like: Filesystem magic number: 0xE0F5E1E2 Filesystem

[PATCH v3] erofs-utils: lib: treat data blocks filled with 0s as a hole

2024-04-17 Thread Sandeep Dhavale via Linux-erofs
Add optimization to treat data blocks filled with 0s as a hole. Even though diskspace savings are comparable to chunk based or dedupe, having no block assigned saves us redundant disk IOs during read. To detect blocks filled with zeros during chunking, we insert block filled with zeros

[PATCH] erofs-utils: mkfs: skip the redundant write for ztailpacking block

2024-04-17 Thread Yifan Zhao
z_erofs_merge_segment() doesn't consider the ztailpacking block in the extent list and unnecessarily writes it back to the disk. This patch fixes this issue by introducing a new `inlined` field in the struct `z_erofs_inmem_extent`. Signed-off-by: Yifan Zhao --- include/erofs/dedupe.h | 2 +-

Re: [PATCH 24/26] netfs: Remove the old writeback code

2024-04-17 Thread David Howells
Jeff Layton wrote: > #23 and #24 should probably be merged. I don't see any reason to do the > two-step of ifdef'ing out the code and then removing it. Just go for it > at this point in the series. I would prefer to keep the ~500 line patch that's rearranging the plumbing separate from the

Re: [PATCH 17/26] netfs: Fix writethrough-mode error handling

2024-04-17 Thread David Howells
Jeff Layton wrote: > Should this be merged independently? It looks like a bug that's present > now. Yes. I've just posted that as a separate fix for Christian to pick up. I still need to keep it in this set, though, until it is upstream. David

Re: [PATCH 09/26] mm: Provide a means of invalidation without using launder_folio

2024-04-17 Thread David Howells
Jeff Layton wrote: > I'd have liked to have seen the first caller of this function too. Looking again at my code, I also need to make netfs_unbuffered_write_iter() use this function too. I missed it before because that wasn't calling invalidate_inode_pages2_range() directly, but rather going

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

2024-04-17 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: