Re: [f2fs-dev] [PATCH v4] f2fs:fix missing space reclamation during the recovery process

2025-09-06 Thread Wang Xiaojun via Linux-f2fs-devel
在 9/5/2025 4:07 PM, Chao Yu 写道: On 9/4/2025 5:35 PM, Wang Xiaojun wrote: Hi Chao, We previously thought that "triggering checkpoint for fsync after falloc -k" could solve this problem. But I found that the above method can be invalid in the following scenarios. case 1: writ

Re: [f2fs-dev] [PATCH v4] f2fs:fix missing space reclamation during the recovery process

2025-09-04 Thread Wang Xiaojun via Linux-f2fs-devel
5 12:49 PM, 王晓珺 写道: 在 8/28/2025 9:44 AM, Chao Yu 写道: On 8/26/25 09:48, 王晓珺 wrote: 在 8/25/2025 10:08 AM, Chao Yu 写道: On 8/20/25 15:54, Wang Xiaojun wrote: This patch fixes missing space reclamation during the recovery process. In the following scenarios, F2FS cannot reclaim truncated space. cas

[f2fs-dev] [PATCH v4] f2fs:fix missing space reclamation during the recovery process

2025-08-20 Thread Wang Xiaojun via Linux-f2fs-devel
process, it is difficult to distinguish between the above two types of falloc. So in this case of falloc -k we need to trigger a checkpoint for fsync. Fixes: d624c96fb3249 ("f2fs: add recovery routines for roll-forward") Signed-off-by: Wang Xiaojun --- v4: Trigger checkpoint for fsync af

[f2fs-dev] [PATCH v3] f2fs:fix missing space reclamation during the recovery process

2025-08-07 Thread Wang Xiaojun via Linux-f2fs-devel
During the recovery process, F2FS will recover file A, but the 1M-1G space cannot be reclaimed. Fixes: d624c96fb3249 ("f2fs: add recovery routines for roll-forward") Signed-off-by: Wang Xiaojun --- v3: Add a Fixes line. v2: Apply Chao's suggestion from v1. No logical changes. v1: Fi

[f2fs-dev] [PATCH v2] f2fs:fix missing space reclamation during the recovery process

2025-08-06 Thread Wang Xiaojun via Linux-f2fs-devel
During the recovery process, F2FS will recover file A, but the 1M-1G space cannot be reclaimed. Signed-off-by: Wang Xiaojun --- v2: Apply Chao's suggestion from v1. No logical changes. v1: Fix missing space reclamation during the recovery process. --- fs/f2fs/f2fs.h | 1 + fs/f2fs/recov

[f2fs-dev] [PATCH] f2fs:reclaim truncated space during the recovery process

2025-07-31 Thread Wang Xiaojun via Linux-f2fs-devel
cannot be reclaimed. Signed-off-by: Wang Xiaojun --- fs/f2fs/f2fs.h | 1 + fs/f2fs/recovery.c | 15 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 46be7560548c..d37204567b66 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs

[f2fs-dev] [PATCH] f2fs: remove redundant parameter judgment

2022-03-14 Thread Wang Xiaojun via Linux-f2fs-devel
iput() has already judged the incoming parameter, so there is no need to repeat the judgment here. Signed-off-by: Wang Xiaojun --- fs/f2fs/namei.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 5f213f05556d..b7c9b602bd72 100644

Re: [f2fs-dev] [PATCH] f2fs-tools: fix the wrong sbi->cur_cp setting

2021-10-25 Thread Wang Xiaojun
在 2021/10/26 9:47, Chao Yu 写道: On 2021/10/26 9:38, Wang Xiaojun wrote: 在 2021/10/26 8:29, Chao Yu 写道: On 2021/10/25 20:09, Wang Xiaojun wrote: If sbi->cur_cp is 2 and the duplicate_checkpoint function returns in advance because sbi->cp_backuped is set to true, we cannot set sbi->cu

Re: [f2fs-dev] [PATCH] f2fs-tools: fix the wrong sbi->cur_cp setting

2021-10-25 Thread Wang Xiaojun
在 2021/10/26 8:29, Chao Yu 写道: On 2021/10/25 20:09, Wang Xiaojun wrote: If sbi->cur_cp is 2 and the duplicate_checkpoint function returns in advance because sbi->cp_backuped is set to true, we cannot set sbi->cur_cp to 1. Hmmm, in previous implementation, what problem we will encou

[f2fs-dev] [PATCH] f2fs-tools: fix the wrong sbi->cur_cp setting

2021-10-25 Thread Wang Xiaojun
If sbi->cur_cp is 2 and the duplicate_checkpoint function returns in advance because sbi->cp_backuped is set to true, we cannot set sbi->cur_cp to 1. Signed-off-by: Wang Xiaojun --- fsck/fsck.c | 3 --- fsck/mount.c | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --g

[f2fs-dev] [PATCH v3] f2fs-tools: rebuild the quota inode if it is corrupted

2021-07-19 Thread Wang Xiaojun
quota inode is corrupted, we need to rebuild it. Signed-off-by: Wang Xiaojun Reviewed-by: Chao Yu --- v2->v3: -Add error message when reserve new block fails. v1->v2: -Update footer.cp_ver based on CP_CRC_RECOVERY_FLAG. -Add debug message in f2fs_rebuild_qf_inode. -Add time_

[f2fs-dev] [PATCH v2] f2fs-tools: rebuild the quota inode if it is corrupted

2021-07-19 Thread Wang Xiaojun
quota inode is corrupted, we need to rebuild it. Signed-off-by: Wang Xiaojun --- v1->v2: -Update footer.cp_ver based on CP_CRC_RECOVERY_FLAG. -Add debug message in f2fs_rebuild_qf_inode. -Add time_t parameter to the f2fs_init_qf_inode. --- fsck/fsck.c| 2 ++ fsck/fsck.h| 1

[f2fs-dev] [PATCH] f2fs-tools: rebuild the quota inode if it is corrupted

2021-07-13 Thread Wang Xiaojun
quota inode is corrupted, we need to rebuild it. Signed-off-by: Wang Xiaojun --- fsck/fsck.c| 2 ++ fsck/fsck.h| 1 + fsck/node.c| 38 ++ include/f2fs_fs.h | 40 mkfs/f2fs_f

[f2fs-dev] [PATCH v2] f2fs: avoid to create an empty string as the extension_list

2021-07-09 Thread Wang Xiaojun
When creating a file, we need to set the temperature based on extension_list. If the empty string is a valid extension_list, the is_extension_exist will always returns true, which affects the separation of hot and cold. Signed-off-by: Wang Xiaojun --- v1->v2:let the caller do the check on @n

[f2fs-dev] [PATCH] f2fs: avoid to create an empty string as the extension_list

2021-07-08 Thread Wang Xiaojun
When creating a file, we need to set the temperature based on extension_list. If the empty string is a valid extension_list, the is_extension_exist will always returns true, which affects the separation of hot and cold. Signed-off-by: Wang Xiaojun --- fs/f2fs/namei.c | 2 ++ 1 file changed, 2

[f2fs-dev] [PATCH] f2fs-tools: fix wrong value of reserve_new_block parameter in page_symlink

2021-07-06 Thread Wang Xiaojun
In page_symlink, reserve_new_block applies address for data block, not for inodes. Therefore, is_inode is set to 0. Signed-off-by: Wang Xiaojun --- fsck/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck/dir.c b/fsck/dir.c index aeb876d..f7491a7 100644 --- a/fsck

[f2fs-dev] [PATCH] f2fs: replace ERANGE with ENAMETOOLONG in file name length check

2021-06-14 Thread Wang Xiaojun
ERANGE indicates that the math result is not representative. Here, ENAMETOOLONG is used to replace ERANGE. Signed-off-by: Wang Xiaojun --- fs/f2fs/xattr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index c8f34decbf8e..eb827c10e970

[f2fs-dev] [PATCH] f2fs: fix wrong alloc_type in f2fs_do_replace_block

2021-03-25 Thread Wang Xiaojun
If the alloc_type of the original curseg is LFS, when we change_curseg and then do recover curseg, the alloc_type becomes SSR. Signed-off-by: Wang Xiaojun --- fs/f2fs/segment.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index c2866561263e

[f2fs-dev] [PATCH] f2fs: remove unused check on nid

2020-09-20 Thread Wang Xiaojun
The case where nid is 0 will be checked in f2fs_check_nid_range. Remove the unused check. Signed-off-by: Wang Xiaojun --- fs/f2fs/node.c | 8 1 file changed, 8 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index cb1b5b61a1da..c61d5b52e29e 100644 --- a/fs/f2fs/node.c +++ b

[f2fs-dev] [PATCH] f2fs: remove unused check on version_bitmap

2020-09-18 Thread Wang Xiaojun
A NULL will not be return by __bitmap_ptr here. Remove the unused check. Signed-off-by: Wang Xiaojun --- fs/f2fs/node.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index cb1b5b61a1da..2cf11662f784 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c

[f2fs-dev] [PATCH] f2fs: remove duplicated code in sanity_check_area_boundary

2020-09-17 Thread Wang Xiaojun
Use seg_end_blkaddr instead of "segment0_blkaddr + (segment_count << log_blocks_per_seg)". Signed-off-by: Wang Xiaojun --- fs/f2fs/super.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index dfa072fa8081..d9e

[f2fs-dev] [PATCH v2] f2fs: fix wrong total_sections check and fsmeta check

2020-09-17 Thread Wang Xiaojun
Meta area is not included in section_count computation. So the minimum number of total_sections is 1 meanwhile it cannot be greater than segment_count_main. The minimum number of meta segments is 8 (SB + 2 (CP + SIT + NAT) + SSA). Signed-off-by: Wang Xiaojun --- fs/f2fs/segment.h | 1 + fs

[f2fs-dev] [PATCH] f2fs: use kfree() to free variables allocated by match_strdup()

2020-06-17 Thread Wang Xiaojun
Use kfree() instead of kvfree() to free variables allocated by match_strdup(). Because the memory is allocated with kmalloc inside match_strdup(). Signed-off-by: Wang Xiaojun --- fs/f2fs/super.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff

[f2fs-dev] [PATCH] f2fs: remove the unused compr parameter

2020-06-15 Thread Wang Xiaojun
The parameter compr is unused in the f2fs_cluster_blocks function so we no longer need to pass it as a parameter. Signed-off-by: Wang Xiaojun --- fs/f2fs/compress.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index