Whamcloud - gitweb
e2fsck: offer to clear inode table blocks that are insane
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 3 Aug 2014 02:46:16 +0000 (22:46 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 3 Aug 2014 02:46:16 +0000 (22:46 -0400)
commit68d70624e34b90fd153964950b7a2917b5bb3a8c
tree27473c9baf1c668ab64cecf69f8d96cf1ed56850
parent7f43a46fad362435f8420f656c6157dc8be8dd4d
e2fsck: offer to clear inode table blocks that are insane

Add a new behavior flag to the inode scan functions; when specified,
this flag will do some simple sanity checking of entire inode table
blocks.  If all the checksums are ok, we can skip checksum
verification on individual inodes later on.  If more than half of the
inodes look "insane" (bad extent tree root or checksum failure) then
ext2fs_get_next_inode_full() can return a special status code
indicating that what's in the buffer is probably garbage.

When e2fsck' inode scan encounters the 'inode is garbage' return code
it'll offer to zap the inode straightaway instead of trying to recover
anything.  This replaces the previous behavior of asking to zap
anything with a checksum error (strict_csum).

Signed-off-by: Darrick J. Wong <darrick.wong@orale.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c
e2fsck/problem.c
e2fsck/problem.h
lib/ext2fs/ext2_err.et.in
lib/ext2fs/ext2fs.h
lib/ext2fs/inode.c