fsck.f2fs: attempt to identify bad dentries
authorJP Abgrall <jpa@google.com>
Wed, 29 Oct 2014 02:11:52 +0000 (19:11 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 29 Oct 2014 05:03:22 +0000 (22:03 -0700)
commit056e4b04fc44a006d5529bafbf87b1d73296c665
treef0c8668c2e1fa9c78bf87313a11fb04c91340e37
parent5007756839040c8cc27690e7f84587d3e37f1ce4
fsck.f2fs: attempt to identify bad dentries

If a dentry has a bad ino (fsck_chk_nod_blk() fails)
and has a name len of 0, then __chk_dentries() will end up stuck:

....
[__chk_dentries: 663] [  4]-[0x0] name[] len[0x0] ino[0x5f1710dc] type[0xd1]
[ASSERT] (sanity_check_nid: 184)  --> nid is not valid. [0x5f1710dc]
[__chk_dentries: 663] [  4]-[0x0] name[] len[0x0] ino[0x5f1710dc] type[0xd1]
[ASSERT] (sanity_check_nid: 184)  --> nid is not valid. [0x5f1710dc]
[__chk_dentries: 663] [  4]-[0x0] name[] len[0x0] ino[0x5f1710dc] type[0xd1]
[ASSERT] (sanity_check_nid: 184)  --> nid is not valid. [0x5f1710dc]
....

This change tries to identify bad dentries:
 - is the ino a valid NID?
 - is the FILE_TYPE a happy type?

Change-Id: I5fb2f3869c96f2c928baaace148de1af102e558e
Signed-off-by: JP Abgrall <jpa@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/fsck.c
include/f2fs_fs.h