f2fs: fix to handle looped node chain during recovery
authorChao Yu <yuchao0@huawei.com>
Sat, 3 Feb 2018 09:44:39 +0000 (17:44 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sun, 8 Apr 2018 11:11:12 +0000 (04:11 -0700)
commit99f512132e543beeee525f3c118a939334cf0682
tree669141b20153bfd375655ac19a8a42bb8889a8a2
parent66a2346def3d1fca9fb1c6ad54731a1878ca3056
f2fs: fix to handle looped node chain during recovery

There is no checksum in node block now, so bit-transition from hardware
can make node_footer.next_blkaddr being corrupted w/o any detection,
result in node chain becoming looped one.

For this condition, during recovery, in order to avoid running into dead
loop, let's detect it and just skip out.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/recovery.c