Re: [f2fs-dev] [PATCH v2 4/4] mkfs.f2fs: refactor format flow for cleanup

2023-05-26 Thread Chao Yu
/ alloc_next_free_block()--- first [PATCH v3 4/4] mkfs.f2fs: refactor format flow for cleanup [PATCH v4 1/2] f2fs-tools: fix to le32 type variable correctly [PATCH v4 2/2] f2fs-tools: reuse feature_table to clean up print_sb_state() --- last Thanks, On 05/26, Chao Yu wrote: During formatting

[f2fs-dev] [PATCH v4 2/2] f2fs-tools: reuse feature_table to clean up print_sb_state()

2023-05-26 Thread Chao Yu
reuse feature_table in print_sb_state() for cleanup. Signed-off-by: Chao Yu --- v4: - use MAX_NR_FEATURE instead of constant fsck/mount.c | 56 +-- include/f2fs_fs.h | 54 +++-- 2 files changed, 52

[f2fs-dev] [PATCH v4 1/2] f2fs-tools: fix to le32 type variable correctly

2023-05-26 Thread Chao Yu
iable sb->feature |= cpu_to_le32(F2FS_FEATURE_ENCRYPT); Signed-off-by: Chao Yu --- v4: - rebase the code fsck/dir.c | 4 +-- fsck/fsck.c | 21 ++- fsck/main.c | 6 ++-- fsck/mount.c| 78 +

[f2fs-dev] [PATCH v3 4/4] mkfs.f2fs: refactor format flow for cleanup

2023-05-26 Thread Chao Yu
, f2fs_write_check_point_pack() can write back cached metadata into CP area directly. Signed-off-by: Chao Yu --- v3: - remove trailing whitespace include/f2fs_fs.h | 235 mkfs/f2fs_format.c | 447 ++--- 2 files changed, 336 insertions

[f2fs-dev] [PATCH v3 3/4] mkfs.f2fs: cleanup w/ alloc_next_free_block()

2023-05-26 Thread Chao Yu
blkaddr in each log. Signed-off-by: Chao Yu --- v3: - rebase the code include/f2fs_fs.h | 2 + mkfs/f2fs_format.c | 101 +++-- 2 files changed, 45 insertions(+), 58 deletions(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 8475645..05d27ba

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

2023-05-26 Thread Chao Yu
On 2023/5/27 0:14, Jaegeuk Kim wrote: Is this v9? Why does it have any history anymore? This patch is for kernel module, previous v8 is for peripheral tools. Thanks, On 05/24, Chunhai Guo wrote: find_fsync_dnodes() detect the looped node chain by comparing the loop counter with free

[f2fs-dev] [PATCH v3 2/2] f2fs-tools: reuse feature_table to clean up print_sb_state()

2023-05-26 Thread Chao Yu
reuse feature_table in print_sb_state() for cleanup. Signed-off-by: Chao Yu --- v3: - fix a bug in feature_map() fsck/mount.c | 56 +-- include/f2fs_fs.h | 52 +-- 2 files changed, 50 insertions(+), 58

[f2fs-dev] [PATCH v2 2/2] f2fs-tools: reuse feature_table to clean up print_sb_state()

2023-05-26 Thread Chao Yu
reuse feature_table in print_sb_state() for cleanup. Signed-off-by: Chao Yu --- v2: - add commit message. fsck/mount.c | 56 +-- include/f2fs_fs.h | 42 +-- 2 files changed, 41 insertions(+), 57 deletions(-) diff

[f2fs-dev] [PATCH 1/2] f2fs-tools: fix to le32 type variable correctly

2023-05-26 Thread Chao Yu
iable sb->feature |= cpu_to_le32(F2FS_FEATURE_ENCRYPT); Signed-off-by: Chao Yu --- fsck/dir.c | 4 +-- fsck/fsck.c | 21 ++- fsck/main.c | 6 ++-- fsck/mount.c| 78 + fsck/node.c |

[f2fs-dev] [PATCH 2/2] f2fs-tools: reuse feature_table in print_sb_state()

2023-05-26 Thread Chao Yu
Signed-off-by: Chao Yu --- fsck/mount.c | 56 +-- include/f2fs_fs.h | 42 +-- 2 files changed, 41 insertions(+), 57 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 70e8b46..60ad493 100644 --- a/fsck

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

2023-05-25 Thread Chao Yu
On 2023/5/24 16:33, Chunhai Guo wrote: find_fsync_dnodes() 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

Re: [f2fs-dev] [PATCH 3/4] mkfs.f2fs: cleanup w/ alloc_next_free_block()

2023-05-25 Thread Chao Yu
On 2023/5/24 9:40, Jaegeuk Kim wrote: On 05/18, Chao Yu wrote: On 2023/5/18 9:36, Jaegeuk Kim wrote: On 05/17, Chao Yu wrote: Introduce alloc_next_free_block() to wrap below openned codes: blkaddr = get_sb(main_blkaddr) + c.cur_seg[curseg_type

[f2fs-dev] [PATCH v2 4/4] mkfs.f2fs: refactor format flow for cleanup

2023-05-25 Thread Chao Yu
, f2fs_write_check_point_pack() can write back cached metadata into CP area directly. Signed-off-by: Chao Yu --- v2: - use NR_CURSEG_TYPE in struct f2fs_configuration include/f2fs_fs.h | 235 mkfs/f2fs_format.c | 449 ++--- 2 files

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

2023-05-25 Thread Chao Yu
ode->i_flags update. Signed-off-by: Chao Yu --- v2: - fix to detect i_flags status correctly. fs/f2fs/super.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 51812f459581..1cf84c993d7c 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -

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

2023-05-24 Thread Chao Yu
failed [ 35.856106] fsck.f2fs: fsck.f2fs terminated by exit(255) Signed-off-by: Chunhai Guo Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux

Re: [f2fs-dev] [PATCH 3/4] mkfs.f2fs: cleanup w/ alloc_next_free_block()

2023-05-24 Thread Chao Yu
On 2023/5/24 9:40, Jaegeuk Kim wrote: On 05/18, Chao Yu wrote: On 2023/5/18 9:36, Jaegeuk Kim wrote: On 05/17, Chao Yu wrote: Introduce alloc_next_free_block() to wrap below openned codes: blkaddr = get_sb(main_blkaddr) + c.cur_seg[curseg_type

Re: [f2fs-dev] [PATCH v6] f2fs: add async reset zone command support

2023-05-24 Thread Chao Yu
. This patch enables submit reset zone command asynchornously. It helps decrease average latency of write IOs in high utilization scenario by faster checkpointing. Signed-off-by: Daejun Park Except the change log, it looks good to me. Reviewed-by: C

Re: [f2fs-dev] [PATCH v2] f2fs_io: Fix integer multiplication overflow error in fiemap

2023-05-23 Thread Chao Yu
(argv[2]) * F2FS_BLKSIZE; Signed-off-by: zangyangyang1 Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH v22 19/31] f2fs: Provide a splice-read wrapper

2023-05-23 Thread Chao Yu
cc: Jens Axboe cc: Jaegeuk Kim cc: Chao Yu cc: linux-f2fs-devel@lists.sourceforge.net cc: linux-fsde...@vger.kernel.org cc: linux-bl...@vger.kernel.org cc: linux...@kvack.org Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux

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

2023-05-23 Thread Chao Yu
failed [ 35.856106] fsck.f2fs: fsck.f2fs terminated by exit(255) Signed-off-by: Chunhai Guo Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux

[f2fs-dev] [PATCH] f2fs: clean up w/ sbi->log_sectors_per_block

2023-05-23 Thread Chao Yu
Use sbi->log_sectors_per_block to clean up below calculated one: unsigned int log_sectors_per_block = sbi->log_blocksize - SECTOR_SHIFT; Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/fs/f2fs/seg

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

2023-05-23 Thread Chao Yu
On 2023/5/22 18:34, 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

Re: [f2fs-dev] [PATCH] f2fs_io: Fix integer multiplication overflow error in fiemap

2023-05-23 Thread Chao Yu
On 2023/5/23 15:24, zangyangyang1 wrote: When using fiemap to obtain the block address of files larger than 2GB ((2147483647+1) bytes), an integer multiplication overflow error will occur. This issue is caused by the following code: start = atoi(argv[1]) * F2FS_BLKSIZE; length =

[f2fs-dev] [PATCH v2] f2fs: fix to avoid NULL pointer dereference f2fs_write_end_io()

2023-05-23 Thread Chao Yu
son.cn Tested-by: butt3rflyh4ck Signed-off-by: Chao Yu --- v2: - update commit message a bit - add Tested-by tag fs/f2fs/f2fs.h | 2 +- fs/f2fs/file.c | 2 +- fs/f2fs/gc.c | 21 ++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs

[f2fs-dev] [PATCH] f2fs: don't reset unchangable mount option in f2fs_remount()

2023-05-22 Thread Chao Yu
83b...@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-f2fs-devel/20230522124203.3838360-1-c...@kernel.org Signed-off-by: Chao Yu --- fs/f2fs/super.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c in

Re: [f2fs-dev] A null-ptr-deref bug in f2fs_write_end_io

2023-05-22 Thread Chao Yu
On 2023/5/22 22:20, butt3rflyh4ck wrote: I have tested the patch, it works fine. Thank you, I'd like to add below tag in the patch if you don't mind. Tested-by: butt3rflyh4ck Thanks, Regards, butt3rflyh4ck. On Mon, May 22, 2023 at 8:44 PM Chao Yu wrote: On 2023/5/22 11:58

Re: [f2fs-dev] [DISCUSSION] f2fs for desktop

2023-05-22 Thread Chao Yu
. Thanks, Maybe it could be an indication on whether it works properly or not? Thanks, On Thu, May 18, 2023 at 4:53 PM Chao Yu wrote: On 2023/4/21 1:26, Juhyung Park wrote: Hi Chao, On Fri, Apr 21, 2023 at 1:19 AM Chao Yu wrote: Hi JuHyung, Sorry for delay reply. On 2023/4/11 1:03

Re: [f2fs-dev] A null-ptr-deref bug in f2fs_write_end_io

2023-05-22 Thread Chao Yu
19, 2023 at 11:24 PM Chao Yu wrote: Hi, Thanks for the report, it will be helpful if you can provide a reproducer. On 2023/5/19 15:13, butt3rflyh4ck wrote: Hi, there is a null-ptr-deref bug in f2fs_write_end_io in fs/f2fs/data.c, I reproduce it in the latest kernel too. #Quick description

[f2fs-dev] [PATCH] f2fs: fix to avoid NULL pointer dereference f2fs_write_end_io()

2023-05-22 Thread Chao Yu
cn Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 2 +- fs/f2fs/file.c | 2 +- fs/f2fs/gc.c | 21 ++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index a4bff3b5b887..e3ef321d4fbb 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs

Re: [f2fs-dev] A null-ptr-deref bug in f2fs_write_end_io

2023-05-19 Thread Chao Yu
Hi, Thanks for the report, it will be helpful if you can provide a reproducer. On 2023/5/19 15:13, butt3rflyh4ck wrote: Hi, there is a null-ptr-deref bug in f2fs_write_end_io in fs/f2fs/data.c, I reproduce it in the latest kernel too. #Quick description When a thread always calls

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

2023-05-18 Thread Chao Yu
failed [ 35.856106] fsck.f2fs: fsck.f2fs terminated by exit(255) Signed-off-by: Chunhai Guo Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux

[f2fs-dev] [PATCH] f2fs: fix to use le32_to_cpu() in RAW_IS_INODE()

2023-05-18 Thread Chao Yu
__le32 type variable should be converted w/ le32_to_cpu() before access. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 7f6c51a6b930..a4bff3b5b887 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs

[f2fs-dev] [PATCH] fsck.f2fs: fix to use le32_to_cpu() in IS_INODE()

2023-05-18 Thread Chao Yu
And use IS_INODE() to clean up codes. Signed-off-by: Chao Yu --- fsck/fsck.c | 7 +++ fsck/mount.c | 4 ++-- fsck/node.h | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index d03f1da..ac4cd98 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c

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

2023-05-18 Thread Chao Yu
On 2023/5/18 17:10, Chao Yu wrote: On 2023/5/18 12:11, 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

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

2023-05-18 Thread Chao Yu
On 2023/5/18 12:11, 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

[f2fs-dev] [PATCH v2] f2fs: support background_gc=adjust mount option

2023-05-18 Thread Chao Yu
bD_t2K6U=t...@mail.gmail.com Original patch was developed by Weichao Guo, I refactor it a bit and rebase the code. Signed-off-by: Weichao Guo Signed-off-by: Chao Yu --- v2: - fix typo - disable IO aware for perf/lifetime mode - check bggc mode in get_max_age() Documentation/filesystems/f2f

Re: [f2fs-dev] [DISCUSSION] f2fs for desktop

2023-05-18 Thread Chao Yu
On 2023/4/21 1:26, Juhyung Park wrote: Hi Chao, On Fri, Apr 21, 2023 at 1:19 AM Chao Yu wrote: Hi JuHyung, Sorry for delay reply. On 2023/4/11 1:03, Juhyung Park wrote: Hi Chao, On Tue, Apr 11, 2023 at 12:44 AM Chao Yu wrote: Hi Juhyung, On 2023/4/4 15:36, Juhyung Park wrote: Hi

[f2fs-dev] [PATCH] f2fs: support background_gc=adjust mount option

2023-05-18 Thread Chao Yu
I refactor it a bit and rebase the code. Signed-off-by: Weichao Guo Signed-off-by: Chao Yu --- Documentation/filesystems/f2fs.rst | 7 ++- fs/f2fs/f2fs.h | 4 ++ fs/f2fs/gc.c | 92 +- fs/f2fs/gc.h | 23 ++

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

2023-05-17 Thread Chao Yu
On 2023/5/18 9:21, Jaegeuk Kim wrote: Applied the below comments. Thanks. Reviewed-by: Chao Yu Thanks, On 05/17, Chao Yu wrote: 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

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

2023-05-17 Thread Chao Yu
In IRQ context, it wakes up workqueue to record errors into on-disk superblock fields rather than in-memory fields. Fixes: 1aa161e43106 ("f2fs: fix scheduling while atomic in decompression path") Fixes: 95fa90c9e5a7 ("f2fs: support recording errors into superblock") Signed-off

Re: [f2fs-dev] [PATCH 3/4] mkfs.f2fs: cleanup w/ alloc_next_free_block()

2023-05-17 Thread Chao Yu
On 2023/5/18 9:36, Jaegeuk Kim wrote: On 05/17, Chao Yu wrote: Introduce alloc_next_free_block() to wrap below openned codes: blkaddr = get_sb(main_blkaddr) + c.cur_seg[curseg_type] * c.blks_per_seg + c.curseg_offset[curseg_type

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

2023-05-17 Thread Chao Yu
On 2023/5/17 20:46, 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

[f2fs-dev] [PATCH 2/2] f2fs: renew value of F2FS_FEATURE_*

2023-05-17 Thread Chao Yu
Define F2FS_FEATURE_* macro w/ 32-bits value rather than 16-bits value. No logic changes. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 6719cf1c5596

[f2fs-dev] [PATCH 1/2] f2fs: renew value of F2FS_MOUNT_*

2023-05-17 Thread Chao Yu
Then we can just define newly introduced mount option w/ lasted free number rather than random free one. Just cleanup, no logic changes. Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 56 +- 1 file changed, 28 insertions(+), 28 deletions(-) diff

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

2023-05-17 Thread Chao Yu
On 2023/5/17 11:59, Wu Bo wrote: 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 i

[f2fs-dev] [PATCH 4/4] mkfs.f2fs: refactor format flow for cleanup

2023-05-17 Thread Chao Yu
, f2fs_write_check_point_pack() can write back cached metadata into CP area directly. Signed-off-by: Chao Yu --- include/f2fs_fs.h | 235 mkfs/f2fs_format.c | 449 ++--- 2 files changed, 337 insertions(+), 347 deletions(-) diff --git

[f2fs-dev] [PATCH 3/4] mkfs.f2fs: cleanup w/ alloc_next_free_block()

2023-05-17 Thread Chao Yu
blkaddr in each log. Signed-off-by: Chao Yu --- include/f2fs_fs.h | 2 + mkfs/f2fs_format.c | 101 +++-- 2 files changed, 45 insertions(+), 58 deletions(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 8475645..05d27ba 100644 --- a/include

[f2fs-dev] [PATCH 1/4] f2fs-tools: add noatime for quota file

2023-05-17 Thread Chao Yu
FS_IMMUTABLE_FL is in-memory one. Signed-off-by: Chao Yu --- fsck/node.c | 2 +- include/f2fs_fs.h | 7 ++- mkfs/f2fs_format.c | 2 +- tools/f2fs_io/f2fs_io.h | 4 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/fsck/node.c b/fsck/node.c index

[f2fs-dev] [PATCH 2/4] mkfs.f2fs: remove unneeded nat initialization in f2fs_update_nat_root()

2023-05-17 Thread Chao Yu
- remove unneeded nat initialization for root/quota inode due to it has been initialized in nat journal. - name f2fs_update_nat_root() to f2fs_update_nat_default(). Signed-off-by: Chao Yu --- mkfs/f2fs_format.c | 24 ++-- 1 file changed, 2 insertions(+), 22 deletions

[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

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

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

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

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?

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

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 ma

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.

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

2023-05-16 Thread Chao Yu
ode->i_flags update. Signed-off-by: Chao Yu --- fs/f2fs/super.c | 9 + 1 file changed, 9 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 9f15b03037db..5d3ac196f0d5 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2713,6 +2713,7 @@ static int f2fs_quota_enable(

[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

[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

[f2fs-dev] [PATCH] f2fs: fix potential deadlock due to unpaired node_write lock use

2023-05-14 Thread Chao Yu
ite); - vfs_cleanup_quota_inode - inode->i_flags &= ~S_NOQUOTA; if (IS_NOQUOTA()) f2fs_up_read(>node_write); Fixes: 79963d967b49 ("f2fs: shrink node_write lock coverage") Signed-off-by: Chao Yu ---

[f2fs-dev] [PATCH 4/4] fsck.f2fs: lookup and relink root inode

2023-05-12 Thread Chao Yu
512 -> 1024 [write_nat_bits:1737] Writing NAT bits pages, at offset 0x03ff Info: Write valid nat_bits in checkpoint Info: write_checkpoint() cur_cp:1 [write_nat_bits:1737] Writing NAT bits pages, at offset 0x03ff Info: Write valid nat_bits in checkpoint Info: fix_checkpoint() cur_cp:

[f2fs-dev] [PATCH 2/4] fsck.f2fs: use f2fs_is_valid_blkaddr()

2023-05-12 Thread Chao Yu
use f2fs_is_valid_blkaddr() instead of IS_VALID_BLK_ADDR() to check validity of data/node's block address. use is_valid_data_blkaddr() in sanity_check_nid() to check NULL_ADDR as NEW_ADDR, and print the value in error path explicitly. Signed-off-by: Chao Yu --- fsck/dump.c | 5 +++-- fsck

[f2fs-dev] [PATCH 3/4] fsck.f2fs: add more debug info in fsck_verify()

2023-05-12 Thread Chao Yu
matched with CP [Fail] [0x1, 0x0] Info: flush_journal_entries() n_nats: 1, n_sits: 6 Info: write_checkpoint() cur_cp:1 Info: fix_checkpoint() cur_cp:1 Signed-off-by: Chao Yu --- fsck/fsck.c | 18 +- fsck/mount.c | 7 ++- 2 files changed, 19 insertions(+), 6

[f2fs-dev] [PATCH 1/4] fsck.f2fs: wrap openned codes into fsck_sanity_check_nid()

2023-05-12 Thread Chao Yu
read_all_xattrs() is the only user of fsck_sanity_check_nid(), wrap openned codes of read_all_xattrs() into fsck_sanity_check_nid(). Then fsck_sanity_check_nid() can be reused later. Signed-off-by: Chao Yu --- fsck/fsck.c | 16 fsck/fsck.h | 3 +-- fsck/xattr.c | 12

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

2023-05-05 Thread Chao Yu
On 2023/5/4 22:44, 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 --- man/f2fs_io.8 | 4 tools/f2fs_io/f2fs_io.c | 35

Re: [f2fs-dev] [PATCH] f2fs: fix to call invalidate_mapping_pages in f2fs_move_file_range

2023-05-05 Thread Chao Yu
On 2023/5/5 2:52, Yangtao Li wrote: In the following scenario, after executing the move_range ioctl syscall, the block size of the source file is 0, but data can still be read. # stat test File: test Size: 6 Blocks: 8 IO Block: 4096 regular file #

Re: [f2fs-dev] [PATCH] fsck.f2fs: Detect looped node chain more efficiently.

2023-05-05 Thread Chao Yu
On 2023/5/4 11:30, Chunhai Guo wrote: Now we 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 it more efficient. Below is the log we

Re: [f2fs-dev] [PATCH v5] f2fs: add async reset zone command support

2023-05-05 Thread Chao Yu
On 2023/5/4 11:26, Daejun Park wrote: v4 -> v5 Added f2fs iostat for zone reset command. v3 -> v4 Fixed build error caused by unused function. v2 -> v3 Modified arguments to be correct for ftrace parameter. Changed __submit_zone_reset_cmd to void return. Refactored the f2fs_wait_discard_bio

[f2fs-dev] [PATCH 3/6] f2fs-tools: fix typo in f2fs_inode structure

2023-05-05 Thread Chao Yu
:%s/i_compress_algrithm/i_compress_algorithm/g Signed-off-by: Chao Yu --- fsck/mount.c | 2 +- fsck/segment.c | 2 +- include/f2fs_fs.h | 2 +- mkfs/f2fs_format.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 2e1634f

[f2fs-dev] [PATCH 2/6] f2fs-tools: rename i_padding to i_compress_flag

2023-05-05 Thread Chao Yu
Commit b28f047b28c5 ("f2fs: compress: support chksum") renames i_padding to i_compress_flag in struct f2fs_inode, adjust f2fs-tools' codes as well. Signed-off-by: Chao Yu --- fsck/mount.c | 2 +- include/f2fs_fs.h | 5 - mkfs/f2fs_format.c | 4 ++-- 3 files changed, 7

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

2023-05-05 Thread Chao Yu
No logic changes. Signed-off-by: Chao Yu --- fsck/node.c| 7 ++- include/f2fs_fs.h | 36 +- mkfs/f2fs_format.c | 118 - 3 files changed, 50 insertions(+), 111 deletions(-) diff --git a/fsck/node.c b/fsck/node.c index c3e383b

[f2fs-dev] [PATCH 1/6] f2fs-tools: add packed attribute for struct f2fs_super_block

2023-05-05 Thread Chao Yu
Otherwise, it may trigger static assert below when the structure updates. static_assert(sizeof(struct f2fs_super_block) == 3072, "") Signed-off-by: Chao Yu --- include/f2fs_fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/f2fs_fs.h b/include/f2fs_

[f2fs-dev] [PATCH 5/6] f2fs-tools: print more raw sb info

2023-05-05 Thread Chao Yu
] qf_ino[USRQUOTA][0x 4 : 4] qf_ino[GRPQUOTA][0x 5 : 5] qf_ino[PRJQUOTA][0x 6 : 6] s_encoding [0x 0 : 0] crc [0x 0 : 0] Signed-off-by: Chao

[f2fs-dev] [PATCH 4/6] f2fs-tools: add DISP_u8() macro

2023-05-05 Thread Chao Yu
Introduce DISP_u8(), and use DISP_u16() and DISP_u8() to print below fields: - i_compress_algorithm - i_log_cluster_size - i_compress_flag Signed-off-by: Chao Yu --- fsck/mount.c | 6 +++--- include/f2fs_fs.h | 11 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git

Re: [f2fs-dev] [syzbot] [f2fs?] WARNING: lock held when returning to user space in f2fs_write_single_data_page

2023-05-04 Thread Chao Yu
Hi, On 2023/5/4 21:31, syzbot wrote: Hello, syzbot has tested the proposed patch but the reproducer is still triggering an issue: It said the reproducer is still triggering an issue, however, there is no error output from the test. Could you please help to check whether such status is

Re: [f2fs-dev] (2) [PATCH v4] f2fs: add async reset zone command support

2023-05-03 Thread Chao Yu
On 2023/5/4 10:08, Daejun Park wrote: Thank you for reviewing the patch. - Original Message - Sender : Chao Yu  Date : 2023-05-04 10:43 (GMT+9) Title : Re: [PATCH v4] f2fs: add async reset zone command support To : 박대준, jaeg...@kernel.org, rost...@goodmis.org, mhira

Re: [f2fs-dev] [PATCH v4] f2fs: add async reset zone command support

2023-05-03 Thread Chao Yu
On 2023/5/2 12:16, Daejun Park wrote: Changelog: v3 -> v4 Fixed build error caused by unused function. v2 -> v3 Modified arguments to be correct for ftrace parameter. Changed __submit_zone_reset_cmd to void return. Refactored the f2fs_wait_discard_bio function. Fixed code that was previously

Re: [f2fs-dev] [PATCH v2] f2fs: do not allow to defragment files have FI_COMPRESS_RELEASED

2023-04-27 Thread Chao Yu
On 2023/4/28 0:21, Jaegeuk Kim wrote: On 04/27, Chao Yu wrote: On 2023/4/26 0:47, Yangtao Li wrote: If a file has FI_COMPRESS_RELEASED, all writes for it should not be allowed. Fixes: 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE") Signed-off-by: Qi H

Re: [f2fs-dev] [PATCH] f2fs: remove some dead code

2023-04-27 Thread Chao Yu
)); return ret; Let's get rid of "ret" as well: return filemap_check_errors(NODE_MAPPING(sbi)); Applied with this modification. Thanks. Reviewed-by: Chao Yu Thanks, regards, dan carpenter ___ Linux-f2fs-devel mailing list

Re: [f2fs-dev] [PATCH v3] f2fs: refactor struct f2fs_attr macro

2023-04-27 Thread Chao Yu
On 2023/4/26 0:19, Yangtao Li wrote: This patch provides a large number of variants of F2FS_RW_ATTR and F2FS_RO_ATTR macros, reducing the number of parameters required to initialize the f2fs_attr structure. Reported-by: kernel test robot Link:

Re: [f2fs-dev] [PATCH v2] f2fs: do not allow to defragment files have FI_COMPRESS_RELEASED

2023-04-27 Thread Chao Yu
On 2023/4/26 0:47, Yangtao Li wrote: If a file has FI_COMPRESS_RELEASED, all writes for it should not be allowed. Fixes: 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE") Signed-off-by: Qi Han Signed-off-by: Yangtao Li Oh, I just see v2. Reviewed-b

Re: [f2fs-dev] [PATCH v2] f2fs: add sanity check for proc_mkdir

2023-04-27 Thread Chao Yu
On 2023/4/26 0:06, Yangtao Li wrote: Return -ENOMEM when proc_mkdir failed. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists

Re: [f2fs-dev] [PATCH] f2fs: do not allow to defragment files have FI_COMPRESS_RELEASED

2023-04-27 Thread Chao Yu
On 2023/4/25 23:11, Yangtao Li wrote: If a file has FI_COMPRESS_RELEASED, all writes for it should not be allowed. Fixes: 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE") Signed-off-by: Qi Han Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 3 +++ 1 file

Re: [f2fs-dev] [PATCH v2] f2fs: add async reset zone command support

2023-04-25 Thread Chao Yu
On 2023/4/25 16:10, Daejun Park wrote: Changelog: v1 -> v2 Changed to apply the optional async reset write pointer by default. This patch enables submit reset zone command asynchornously. It helps decrease average latency of write IOs in high utilization scenario by faster checkpointing.

Re: [f2fs-dev] [PATCH -next] f2fs: remove redundant goto statement in f2fs_read_single_page()

2023-04-24 Thread Chao Yu
On 2023/4/25 7:46, Li Zetao wrote: After the commit "0a4ee518185", this "goto" statement was redundant, remote it for clean code. Signed-off-by: Li Zetao Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing l

Re: [f2fs-dev] [PATCH] f2fs: allocate node blocks for atomic write block replacement

2023-04-24 Thread Chao Yu
On 2023/4/24 23:44, Daeho Jeong wrote: From: Daeho Jeong When a node block is missing for atomic write block replacement, we need to allocate it in advance of the replacement. Fixes: 3db1de0e582c ("f2fs: change the current atomic write way") Signed-off-by: Daeho Jeong Reviewed-b

Re: [f2fs-dev] [PATCH] f2fs: use cow inode data when updating atomic write

2023-04-24 Thread Chao Yu
aeho Jeong Reviewed-by: Chao Yu Thanks, ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH] f2fs: add sanity check for proc_mkdir

2023-04-23 Thread Chao Yu
On 2023/4/7 3:37, Yangtao Li wrote: Return -ENOMEM when proc_mkdir failed. Signed-off-by: Yangtao Li --- fs/f2fs/sysfs.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 3aad3500a701..dcd497e0920a 100644 ---

[f2fs-dev] [PATCH v11] f2fs: support errors=remount-ro|continue|panic mountoption

2023-04-23 Thread Chao Yu
N/A By default it uses "continue" mode. [Yangtao helps to clean up function's name] Signed-off-by: Yangtao Li Signed-off-by: Chao Yu --- v11: - fix compile warning of doc and clean up its format - add more description in commit message Documentation/filesystems/f2fs.rst | 16 +++

Re: [f2fs-dev] [PATCH] f2fs: remove unnessary comment in __may_age_extent_tree

2023-04-22 Thread Chao Yu
On 2023/4/22 3:20, Jaegeuk Kim wrote: On 04/21, Chao Yu wrote: On 2023/4/18 14:09, Qi Han wrote: This comment make no sense and is in the wrong place, so let's remove it. Signed-off-by: Qi Han --- fs/f2fs/extent_cache.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/f2fs

Re: [f2fs-dev] [PATCH v8] f2fs: support errors=remount-ro|continue|panic mountoption

2023-04-22 Thread Chao Yu
On 2023/4/22 3:31, Jaegeuk Kim wrote: On 04/21, Chao Yu wrote: On 2023/4/21 0:34, Jaegeuk Kim wrote: On 04/20, Chao Yu wrote: On 2023/4/20 4:19, Jaegeuk Kim wrote: On 04/08, Chao Yu wrote: This patch supports errors=remount-ro|continue|panic mount option, by default it uses "remou

[f2fs-dev] [PATCH v10] f2fs: support errors=remount-ro|continue|panic mountoption

2023-04-22 Thread Chao Yu
This patch supports errors=remount-ro|continue|panic mount option, by default it uses "continue" mode. Signed-off-by: Yangtao Li Signed-off-by: Chao Yu --- v10: - add description of error mode in f2fs.rst - keep pending node/non-dir pages in remount-ro mode Documentation/filesystem

Re: [f2fs-dev] [PATCH v2] f2fs: refactor struct f2fs_attr macro

2023-04-20 Thread Chao Yu
On 2023/4/15 23:29, Yangtao Li wrote: This patch provides a large number of variants of F2FS_RW_ATTR and F2FS_RO_ATTR macros, reducing the number of parameters required to initialize the f2fs_attr structure. Reported-by: kernel test robot Link:

Re: [f2fs-dev] [PATCH] f2fs: remove unnessary comment in __may_age_extent_tree

2023-04-20 Thread Chao Yu
On 2023/4/18 14:09, Qi Han wrote: This comment make no sense and is in the wrong place, so let's remove it. Signed-off-by: Qi Han --- fs/f2fs/extent_cache.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c index 28b12553f2b3..1f6d7de35794

<    2   3   4   5   6   7   8   9   10   11   >