[f2fs-dev] [PATCH v6] f2fs-tools: support to show fscrypt_context_v2 in print_xattr_entry

2023-07-17 Thread Weichao Guo via Linux-f2fs-devel
As the fscrypt context has two versions now, this patch adds the support of fscrypt_context_v2 for print_xattr_entry. Signed-off-by: Weichao Guo Signed-off-by: Sheng Yong --- v6: - print notice for unsupported fscrypt_context version v5: - check if e_name/e_name_len is match with F2FS_XATTR_NAME

[f2fs-dev] [PATCH v5] f2fs-tools: support to show fscrypt_context_v2 in print_xattr_entry

2023-07-16 Thread Weichao Guo via Linux-f2fs-devel
As the fscrypt context has two versions now, this patch adds the support of fscrypt_context_v2 for print_xattr_entry. Signed-off-by: Weichao Guo Signed-off-by: Sheng Yong --- fsck/mount.c | 53 +++--- fsck/xattr.h | 55

[f2fs-dev] [PATCH v4] f2fs-tools: support to show fscrypt_context_v2 in print_xattr_entry

2023-07-14 Thread Weichao Guo via Linux-f2fs-devel
As the fscrypt context has two versions now, this patch adds the support of fscrypt_context_v2 for print_xattr_entry. Signed-off-by: Weichao Guo Signed-off-by: Sheng Yong --- fsck/mount.c | 48 ++ fsck/xattr.h | 54

[f2fs-dev] [PATCH v3] f2fs-tools: support to show fscrypt_context_v2 in print_xattr_entry

2023-07-14 Thread Weichao Guo via Linux-f2fs-devel
As the fscrypt context has two versions now, this patch adds the support of fscrypt_context_v2 for print_xattr_entry. Signed-off-by: Weichao Guo Signed-off-by: Sheng Yong --- fsck/mount.c | 48 ++ fsck/xattr.h | 54

[f2fs-dev] [PATCH v2] f2fs-tools: support to show fscrypt_context_v2 in print_xattr_entry

2023-07-14 Thread Weichao Guo via Linux-f2fs-devel
As the fscrypt context has two versions now, this patch adds the support of fscrypt_context_v2 for print_xattr_entry. Signed-off-by: Weichao Guo Signed-off-by: Sheng Yong --- fsck/mount.c | 46 +--- fsck/xattr.h | 54 ++

[f2fs-dev] [PATCH] f2fs-tools: support print_xattr_entry with fscrypt context v2

2023-07-12 Thread Weichao Guo via Linux-f2fs-devel
Signed-off-by: Weichao Guo Signed-off-by: Sheng Yong --- fsck/mount.c | 44 +++--- fsck/xattr.h | 54 +++- 2 files changed, 74 insertions(+), 24 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 397feb

[f2fs-dev] [PATCH] f2fs: let FI_OPU_WRITE override FADVISE_COLD_BIT

2022-09-06 Thread Weichao Guo via Linux-f2fs-devel
Cold files may be fragmented due to SSR, defragment is needed as sequential reads are dominant scenarios of these files. FI_OPU_WRITE should override FADVISE_COLD_BIT to avoid defragment fails. Signed-off-by: Weichao Guo Signed-off-by: Chao Yu --- fs/f2fs/data.c | 2 +- 1 file changed, 1 insert

[f2fs-dev] [PATCH v2] fsck.f2fs: use elapsed_time in checkpoint for period check

2022-08-31 Thread Weichao Guo via Linux-f2fs-devel
We now use walltime for monthly period check. However the walltime is: * unstable(timestamp register reset) and settable(modified by user) * unreasonable(e.g: device power-off for one month, no data changed) When the walltime changes to the past before one month or the future after one month, the

[f2fs-dev] [PATCH] fsck.f2fs: use elapsed_time in checkpoint for period check

2022-08-11 Thread Weichao Guo via Linux-f2fs-devel
We now use walltime for monthly period check. However the walltime is: * unstable(timestamp register reset) and settable(modified by user) * unreasonable(e.g: device power-off for one month, no data changed) When the walltime changes to the past before one month or the future after one month, the

[f2fs-dev] [PATCH] f2fs: allocate consective blkaddrs for defragment

2022-08-11 Thread Weichao Guo via Linux-f2fs-devel
When we try to defrag a file, its data blocks may mess with others if there are lots of concurrent writes. This causes the file is still fragmented after defrag. So It's better to isolate defrag writes from others. Signed-off-by: Weichao Guo Signed-off-by: Chao Yu --- fs/f2fs/debug.c | 4

[f2fs-dev] [PATCH] f2fs: set SBI_NEED_FSCK flag when inconsistent node block found

2021-09-18 Thread Weichao Guo via Linux-f2fs-devel
Inconsistent node block will cause a file fail to open or read, which could make the user process crashes or stucks. Let's mark SBI_NEED_FSCK flag to trigger a fix at next fsck time. After unlinking the corrupted file, the user process could regenerate a new one and work correctly. Signed-off-by:

[f2fs-dev] [PATCH v2] f2fs: do not use AT_SSR mode in FG_GC & high urgent BG_GC

2021-03-17 Thread Weichao Guo via Linux-f2fs-devel
AT_SSR mode is introduced by age threshold based GC for better hot/cold data seperation and avoiding free segment cost. However, LFS write mode is preferred in the scenario of foreground or high urgent GC, which should be finished ASAP. Let's only use AT_SSR in background GC and not high urgent GC

[f2fs-dev] [PATCH] f2fs: do not use AT_SSR mode in FG_GC & high urgent BG_GC

2021-03-17 Thread Weichao Guo via Linux-f2fs-devel
AT_SSR mode is introduced by age threshold based GC for better hot/cold data seperation and avoiding free segment cost. However, LFS write mode is preferred in the scenario of foreground or high urgent GC, which should be finished ASAP. Let's only use AT_SSR in background GC and not high urgent GC

Re: [f2fs-dev] [RFC PATCH] f2fs: do not use CURSEG_ALL_DATA_ATGC in foreground or urgent GC

2021-03-17 Thread Weichao Guo via Linux-f2fs-devel
On 2021/3/17 14:41, Chao Yu wrote: On 2021/3/17 11:44, Weichao Guo wrote: On 2021/3/17 10:40, Chao Yu wrote: On 2021/3/16 21:15, Weichao Guo via Linux-f2fs-devel wrote: CURSEG_ALL_DATA_ATGC is introduced by age threshold based GC for better hot/cold data seperation and avoiding free

Re: [f2fs-dev] [RFC PATCH] f2fs: do not use CURSEG_ALL_DATA_ATGC in foreground or urgent GC

2021-03-16 Thread Weichao Guo via Linux-f2fs-devel
On 2021/3/17 10:40, Chao Yu wrote: On 2021/3/16 21:15, Weichao Guo via Linux-f2fs-devel wrote: CURSEG_ALL_DATA_ATGC is introduced by age threshold based GC for better hot/cold data seperation and avoiding free segment cost. However, LFS write mode is preferred in the scenario of foreground or

[f2fs-dev] [RFC PATCH] f2fs: do not use CURSEG_ALL_DATA_ATGC in foreground or urgent GC

2021-03-16 Thread Weichao Guo via Linux-f2fs-devel
CURSEG_ALL_DATA_ATGC is introduced by age threshold based GC for better hot/cold data seperation and avoiding free segment cost. However, LFS write mode is preferred in the scenario of foreground or urgent GC, which should be finished ASAP. So, let's only use CURSEG_ALL_DATA_ATGC when not urgent in