Re: [f2fs-dev] [PATCH v2] f2fs: replace blk_finish_plug() with blk_flush_plug()

2023-09-05 Thread Chunhai Guo via Linux-f2fs-devel
On 2023/9/5 0:40, Jaegeuk Kim wrote: On 09/04, Chao Yu wrote: On 2023/8/31 15:10, Chunhai Guo wrote: The commit 344150999b7f ("f2fs: fix to avoid potential deadlock") only requires unplugging current->plug. Using blk_finish_plug() is unnecessary as it sets current->plug as NULL and prevents

Re: [f2fs-dev] [PATCH] f2fs: replace blk_finish_plug() with blk_flush_plug()

2023-08-31 Thread Chunhai Guo via Linux-f2fs-devel
在 2023/8/30 22:05, Chao Yu 写道: On 2023/8/30 11:52, Chunhai Guo wrote: The commit 344150999b7f ("f2fs: fix to avoid potential deadlock") only requires unplugging current->plug. Using blk_finish_plug() is unnecessary as it sets current->plug as NULL and prevents wb_writeback() from using plug in s

[f2fs-dev] [PATCH v2] f2fs: replace blk_finish_plug() with blk_flush_plug()

2023-08-31 Thread Chunhai Guo via Linux-f2fs-devel
The commit 344150999b7f ("f2fs: fix to avoid potential deadlock") only requires unplugging current->plug. Using blk_finish_plug() is unnecessary as it sets current->plug as NULL and prevents wb_writeback() from using plug in subsequent loops. Instead, use blk_flush_plug() as a replacement. Signed-

[f2fs-dev] [PATCH] f2fs: replace blk_finish_plug() with blk_flush_plug()

2023-08-29 Thread Chunhai Guo via Linux-f2fs-devel
The commit 344150999b7f ("f2fs: fix to avoid potential deadlock") only requires unplugging current->plug. Using blk_finish_plug() is unnecessary as it sets current->plug as NULL and prevents wb_writeback() from using plug in subsequent loops. Instead, use blk_flush_plug() as a replacement. Signed-

[f2fs-dev] [PATCH v2] f2fs: Only lfs mode is allowed with zoned block device feature

2023-08-03 Thread Chunhai Guo via Linux-f2fs-devel
Now f2fs support four block allocation modes: lfs, adaptive, fragment:segment, fragment:block. Only lfs mode is allowed with zoned block device feature. Signed-off-by: Chunhai Guo --- fs/f2fs/super.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/super.c b

Re: [f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature

2023-08-03 Thread Chunhai Guo via Linux-f2fs-devel
Hi Chao, I have sent the second patch with your suggestion. Please have a check. Thanks. On 2023/8/2 22:52, Chao Yu wrote: On 2023/6/20 22:10, Chunhai Guo wrote: Now f2fs support four block allocation modes: lfs, adaptive, fragment:segment, fragment:block. Only lfs mode is allowed with zoned

Re: [f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature

2023-08-02 Thread Chunhai Guo via Linux-f2fs-devel
Hi Chao & Jaegeuk, Could you please help to review this patch? Thanks. On 2023/6/20 22:10, 郭纯海 wrote: Now f2fs support four block allocation modes: lfs, adaptive, fragment:segment, fragment:block. Only lfs mode is allowed with zoned block device feature. Signed-off-by: Chunhai Guo --- fs/f

Re: [f2fs-dev] [PATCH] f2fs: fix to avoid breaking fsync node chain

2023-06-27 Thread Chunhai Guo via Linux-f2fs-devel
Please ignore this patch. Sorry that I make a mistake. 720037f939fa ("f2fs: don't overwrite node block by SSR") has fixed this issue aleady. On 2023/6/26 22:02, 郭纯海 wrote: The fsync node chain can break when a node block is used, freed and reused in the chain. To avoid this, all blocks in the c

[f2fs-dev] [PATCH] f2fs: fix to avoid breaking fsync node chain

2023-06-26 Thread Chunhai Guo via Linux-f2fs-devel
The fsync node chain can break when a node block is used, freed and reused in the chain. To avoid this, all blocks in the chain should be recorded and not reused before the next checkpoint. However, this approach may require too many resources. Instead, this patch records all related segments in a

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

2023-06-26 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

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

2023-06-25 Thread Chunhai Guo via Linux-f2fs-devel
Hi Jaegeuk & Chao, OK. I will post a final version including the modification. Thanks. On 2023/6/24 2:50, Jaegeuk Kim wrote: On 06/23, Chao Yu wrote: On 2023/5/24 10:42, Chunhai Guo wrote: + if (!c.fix_on) { err = -1; break;

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

2023-06-21 Thread Chunhai Guo via Linux-f2fs-devel
Hi Chao, Sorry for replying late, I have send patch "fsck.f2fs: refactor looped node chain detetected logic for cleanup" as you suggested. Thanks. On 2023/6/17 10:20, Chao Yu wrote: On 2023/6/14 17:27, Chunhai Guo wrote: Hi Jaegeuk, Could you please help to confirm if this patch has been m

[f2fs-dev] [PATCH] fsck.f2fs: refactor looped node chain detetected logic for cleanup

2023-06-21 Thread Chunhai Guo via Linux-f2fs-devel
Refactor looped node chain detected logic for cleanup as kernel does. Suggested-by: Chao Yu Signed-off-by: Chunhai Guo --- fsck/mount.c | 115 --- 1 file changed, 55 insertions(+), 60 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index e5

[f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature

2023-06-20 Thread Chunhai Guo via Linux-f2fs-devel
Now f2fs support four block allocation modes: lfs, adaptive, fragment:segment, fragment:block. Only lfs mode is allowed with zoned block device feature. Signed-off-by: Chunhai Guo --- fs/f2fs/super.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/super.c

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

2023-06-14 Thread Chunhai Guo via Linux-f2fs-devel
Got it. Thanks. On 2023/6/15 0:15, Jaegeuk Kim wrote: On 06/14, Chunhai Guo wrote: Hi Jaegeuk, Could you please help to confirm if this patch has been merged? I cannot see the patch in the dev-test or dev branch. Thanks. Somehow it was dropped. I start to test again. Thanks. On 2023/5/24

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

2023-06-14 Thread Chunhai Guo via Linux-f2fs-devel
Hi Jaegeuk, Could you please help to confirm if this patch has been merged? I cannot see the patch in the dev-test or dev branch. Thanks. On 2023/5/24 10:42, 郭纯海 wrote: find_fsync_inode() detect the looped node chain by comparing the loop counter with free blocks. While it may take tens of s

[f2fs-dev] [PATCH v3] f2fs: Detect looped node chain efficiently

2023-05-27 Thread Chunhai Guo via Linux-f2fs-devel
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 efficient. Signed-off-by: Chunhai Guo --- v2 ->

[f2fs-dev] [PATCH v2] f2fs: Detect looped node chain efficiently

2023-05-26 Thread Chunhai Guo via Linux-f2fs-devel
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 efficient. Signed-off-by: Chunhai Guo --- v1 ->

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

2023-05-24 Thread Chunhai Guo via Linux-f2fs-devel
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 efficient, and fix the issue by filling a NULL ad

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

2023-05-23 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 v7] fsck.f2fs: Detect and fix looped node chain efficiently

2023-05-23 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 v6] fsck.f2fs: Detect and fix looped node chain efficiently

2023-05-22 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 v5] fsck.f2fs: Detect and fix looped node chain efficiently

2023-05-18 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 v4] fsck.f2fs: Detect and fix looped node chain efficiently

2023-05-17 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 v3] fsck.f2fs: Detect and fix looped node chain efficiently

2023-05-17 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 in the last node of t

[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] fsck.f2fs: Detect looped node chain more efficiently.

2023-05-03 Thread Chunhai Guo via Linux-f2fs-devel
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 encounter on a 256GB UFS storage and it t