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>
Mon, 12 Mar 2018 23:05:40 +0000 (08:05 +0900)
commitfb0e72c8b94903be3a7e742ab0a4b53b89e7ee35
treefdbc7f7837aeec1a0f453a17b2640cb41249bc4b
parent0f9ec2a8f65d72a454e99fb4f7351d7e01070385
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