Re: [f2fs-dev] [PATCH 1/1] f2fs: pass I_NEW flag to trace event

2023-05-16 Thread Wu Bo via Linux-f2fs-devel
On 2023/5/17 10:44, Chao Yu wrote: > On 2023/5/16 20:07, Wu Bo wrote: >> Modify the order between 'trace_f2fs_iget' & 'unlock_new_inode', so the >> I_NEW can pass to the trace event when the inode initialised. > > Why is it needed? And trace_f2fs_iget() won't print inode->i_state? When connect a t

[f2fs-dev] [PATCH v2] f2fs: compress: fix to check validity of i_compress_flag field

2023-05-16 Thread Chao Yu
The last valid compress related field is i_compress_flag, check its validity instead of i_log_cluster_size. Signed-off-by: Chao Yu --- v2: - rebase the code. fs/f2fs/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index f8bf75c1

Re: [f2fs-dev] [PATCH v2] fsck.f2fs: Detect and fix looped node chain efficiently

2023-05-16 Thread Chao Yu
On 2023/5/16 22:27, Chunhai Guo wrote: find_fsync_inode() detect the looped node chain by comparing the loop counter with free blocks. While it may take tens of seconds to quit when the free blocks are large enough. We can use Floyd's cycle detection algorithm to make the detection more efficient

Re: [f2fs-dev] [PATCH 1/1] f2fs: pass I_NEW flag to trace event

2023-05-16 Thread Chao Yu
On 2023/5/16 20:07, Wu Bo wrote: Modify the order between 'trace_f2fs_iget' & 'unlock_new_inode', so the I_NEW can pass to the trace event when the inode initialised. Why is it needed? And trace_f2fs_iget() won't print inode->i_state? Thanks, Signed-off-by: Wu Bo --- fs/f2fs/inode.c | 2

Re: [f2fs-dev] [PATCH v1] f2fs: Fix over-estimating free section during FG GC

2023-05-16 Thread Chao Yu
On 2023/5/12 12:16, Yonggil Song wrote: There was a bug that finishing FG GC unconditionally because free sections are over-estimated after checkpoint in FG GC. This patch initializes sec_freed by every checkpoint in FG GC. Signed-off-by: Yonggil Song Reviewed-by: Chao Yu Thanks,

Re: [f2fs-dev] Is compression available under direct-io mode?

2023-05-16 Thread Chao Yu
On 2023/5/12 9:10, Sijie Lan wrote: Hi, guys, When I do some specific test scenarios, I want to do some direct write after data have been compressed in F2FS, but when I track the internal functions, it seems F2FS forces my direct-io request to buffer-io mode. Does it mean we can not do the write

Re: [f2fs-dev] [PATCH] f2fs: add fsnotify_sb_error() in f2fs_save_errors

2023-05-16 Thread Chao Yu
On 2023/5/11 17:13, Yangtao Li wrote: When an EFSCORRUPTED error occurs in f2fs, report the error to userspace monitoring tools. Signed-off-by: Yangtao Li --- fs/f2fs/super.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 51812f459581..42d5aa50

Re: [f2fs-dev] [PATCH 6/6] f2fs-tools: use f2fs_init_inode() to clean up codes

2023-05-16 Thread Chao Yu
On 2023/5/9 3:42, Jaegeuk Kim wrote: Added this to avoid android build failure. --- a/include/f2fs_fs.h +++ b/include/f2fs_fs.h @@ -23,6 +23,7 @@ #include #include +#include #include #include #include Thank you for the fix, :) Thanks, ___

Re: [f2fs-dev] [PATCH v2 1/2] f2fs: move the conditional statement after holding the inode lock in f2fs_move_file_range()

2023-05-16 Thread Chao Yu
On 2023/5/6 22:42, Yangtao Li wrote: For judging the inode flag state, the inode lock must be held. BTW, add compressd file check and to avoid 'if' nesting. Please describe what's the detail problem if we check the flag w/o inode lock. Can we use one single patch to fix all similar issues? Th

Re: [f2fs-dev] [PATCH] f2fs_io: expend fallocate command

2023-05-16 Thread Chao Yu
On 2023/5/6 19:45, Yangtao Li wrote: Expend fallocate command to support more flags. Signed-off-by: Yangtao Li --- tools/f2fs_io/f2fs_io.c | 37 - 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_i

Re: [f2fs-dev] [PATCH v2] f2fs_io: support move_range command

2023-05-16 Thread Chao Yu
On 2023/5/6 19:45, Yangtao Li wrote: This patch supports a new sub-command 'move_range' in f2fs_io to move a range of data blocks from source file to destination file via F2FS_IOC_MOVE_RANGE ioctl. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks,

Re: [f2fs-dev] [PATCH] f2fs: maintain six open zones for zoned devices

2023-05-16 Thread Chao Yu
On 2023/5/5 23:50, Jaegeuk Kim wrote: From: Daeho Jeong To keep six open zone constraints, make them not to be open over six open zones. Signed-off-by: Daeho Jeong Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 57 ++ fs/f2fs/f2fs.h | 5 ++

Re: [f2fs-dev] [PATCH] f2fs: fix the wrong condition to determine atomic context

2023-05-16 Thread Chao Yu
On 2023/5/6 3:18, Jaegeuk Kim wrote: Should use !in_task for irq context. Fixes: 1aa161e43106 ("f2fs: fix scheduling while atomic in decompression path") Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list L

Re: [f2fs-dev] [PATCH] f2fs-tools: allocate memory to handle label

2023-05-16 Thread Chao Yu
On 2023/5/6 0:26, Jaegeuk Kim wrote: Let's avoid memory alignment of sb->volume_name. Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/

[f2fs-dev] [PATCH] f2fs: fix to set noatime and immutable flag for quota file

2023-05-16 Thread Chao Yu
We should set noatime bit for quota files, since no one cares about atime of quota file, and we should set immutalbe bit as well, due to nobody should write to the file through exported interfaces. Meanwhile this patch use inode_lock to avoid race condition during inode->i_flags, f2fs_inode->i_fla

[f2fs-dev] [PATCH v2] f2fs: flush error flags in workqueue

2023-05-16 Thread Chao Yu
In IRQ context, it wakes up workqueue to record errors into on-disk superblock fields rather than in-memory fields. Signed-off-by: Chao Yu --- v2: - make f2fs_record_errors() static. fs/f2fs/compress.c | 2 +- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c| 26 +++--- 3 file

[f2fs-dev] [PATCH v2] fsck.f2fs: Detect and fix looped node chain efficiently

2023-05-16 Thread Chunhai Guo via Linux-f2fs-devel
find_fsync_inode() detect the looped node chain by comparing the loop counter with free blocks. While it may take tens of seconds to quit when the free blocks are large enough. We can use Floyd's cycle detection algorithm to make the detection more efficient, and fix the issue by filling a NULL add

[f2fs-dev] [PATCH 1/1] f2fs: pass I_NEW flag to trace event

2023-05-16 Thread Wu Bo via Linux-f2fs-devel
Modify the order between 'trace_f2fs_iget' & 'unlock_new_inode', so the I_NEW can pass to the trace event when the inode initialised. Signed-off-by: Wu Bo --- fs/f2fs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index cf4327ad106c.

[f2fs-dev] [PATCH] f2fs: flush error flags in workqueue

2023-05-16 Thread Chao Yu
In IRQ context, it wakes up workqueue to record errors into on-disk superblock fields rather than in-memory fields. Signed-off-by: Chao Yu --- fs/f2fs/compress.c | 2 +- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c| 26 +++--- 3 files changed, 25 insertions(+), 4 deletions