Whamcloud - gitweb
e2fsck: track errors/badness found for each inode
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 13 Apr 2012 07:13:58 +0000 (01:13 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 29 May 2012 08:09:25 +0000 (02:09 -0600)
commitf1b53202b1b417e9fac064d6ecee4e20fa750ef4
tree783bc37fecc9c25493fc808a670afdfdf24062af
parentf0c242729f97847b62829e6adebb1e5deaf8d000
e2fsck: track errors/badness found for each inode

The present e2fsck code checks the inode, per field basis.  It
doesn't take into consideration to total sanity of the inode.
This may cause e2fsck turning a garbage inode into an apparently
sane inode ("It is a vessel of fertilizer, and none may abide
its strength.").

The following patch adds a heuristics to detect the degree of
badness of an inode. icount mechanism is used to keep track of
the badness of every inode.  The badness is increased as various
fields in inode are found to be corrupt.  Badness above a certain
threshold value results in deletion of the inode.  The default
badness threshold value is 7, it can be specified to e2fsck
using "-E inode_badness_threshold=<value>"

This can avoid lengthy pass1b shared block processing, where a
corrupt chunk of the inode table has resulted in a bunch of
garbage inodes suddenly having shared blocks with a lot of good
inodes (or each other).

Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
16 files changed:
e2fsck/e2fsck.8.in
e2fsck/e2fsck.c
e2fsck/e2fsck.h
e2fsck/pass1.c
e2fsck/pass1b.c
e2fsck/pass2.c
e2fsck/pass4.c
e2fsck/problem.c
e2fsck/problem.h
e2fsck/super.c
e2fsck/unix.c
lib/ext2fs/ext2fs.h
lib/ext2fs/icount.c
tests/f_messy_inode/expect.1
tests/f_messy_inode/expect.2
tests/f_messy_inode/script [new file with mode: 0644]