Whamcloud - gitweb
e2fsck: track errors/badness found for each inode
authorAndreas Dilger <andreas.dilger@intel.com>
Fri, 13 Apr 2012 07:13:58 +0000 (01:13 -0600)
committerLi Dongyang <dongyangli@ddn.com>
Wed, 29 May 2019 04:46:20 +0000 (14:46 +1000)
commit14f8f8ea47c5d0142fcd70164f83144323799882
tree6edfab8b7405b96f51413aaf361f1bc8087a41e2
parent7b8a9fdf8627c80bee14965ae20c4fd8ab346343
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).

  LU-11882 e2fsck: zero date is not inode badness

  Lustre FS OST has some precreated objects which have zeroed
  creation time. e2fsck adds badness points for such inodes.
  If OST has many precreated objects, e2fsck spends too much time
  during phase2, because processes each of such inode.

  Let's allow Lustre FS inode has zeroed time field for
  precreated objects.

  Change-Id: I171a0fe741449ca99b29b5af51032a7b4c716344
  Cray-bug-id: LUS-6857
Signed-off-by: Artem Blagodarenko <c17828@cray.com>
Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.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]