Re: [f2fs-dev] [PATCH] f2fs: skip f2fs_preallocate_blocks() for overwrite case

2021-10-28 Thread Chao Yu
Ping, On 2021/9/29 8:05, Chao Yu wrote: On 2021/9/29 3:08, Jaegeuk Kim wrote: On 09/28, Chao Yu wrote: In f2fs_file_write_iter(), let's use f2fs_overwrite_io() to check whethere it is overwrite case, for such case, we can skip f2fs_preallocate_blocks() in order to avoid f2fs_do_map_lock(), whi

[f2fs-dev] [PATCH] f2fs: support fault injection for dquot_initialize()

2021-10-28 Thread Chao Yu
This patch adds a new function f2fs_dquot_initialize() to wrap dquot_initialize(), and it supports to inject fault into f2fs_dquot_initialize() to simulate inner failure occurs in dquot_initialize(). Usage: a) echo 65536 > /sys/fs/f2fs//inject_type or b) mount -o fault_type=65536 Signed-off-by:

[f2fs-dev] [PATCH RESEND] f2fs: fix incorrect return value in f2fs_sanity_check_ckpt()

2021-10-28 Thread Chao Yu
As Pavel Machek reported in [1] This code looks quite confused: part of function returns 1 on corruption, part returns -errno. The problem is not stable-specific. [1] https://lkml.org/lkml/2021/9/19/207 Let's fix to make 'insane cp_payload case' to return 1 rater than EFSCORRUPTED, so that retur

[f2fs-dev] [RFC PATCH] f2fs:compress: introduce compress private data slab cache

2021-10-28 Thread Fengnan Chang
Add "f2fs_lzo_compress_private" and "f2fs_lz4_compress_private" slab cache, to speed up memory allocation when init compress ctx. No slab cache is added to zstd as the private data for zstd is related to mount option, and too big. Signed-off-by: Fengnan Chang --- fs/f2fs/compress.c | 45