f2fs: Detect looped node chain efficiently
authorChunhai Guo <guochunhai@vivo.com>
Sat, 27 May 2023 17:06:40 +0000 (01:06 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 12 Jun 2023 20:04:09 +0000 (13:04 -0700)
commit38a4a330c8bf6498bde3be155485c9b44a517fb0
tree8660b79251af1bc01b325a1b6548f7c43bd7f4e1
parent25f9080576b9549be9435123d7e45bfeebd2dc97
f2fs: Detect looped node chain efficiently

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 <guochunhai@vivo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/recovery.c