Whamcloud - gitweb
tests: add test cases for inode badness
authorAndreas Dilger <andreas.dilger@intel.com>
Fri, 13 Apr 2012 07:23:17 +0000 (01:23 -0600)
committerLi Dongyang <dongyangli@ddn.com>
Wed, 14 Apr 2021 05:18:40 +0000 (15:18 +1000)
commit215c12c189ed6965d9677148dae926e7688d641a
tree01cb06227c1802b48c40a7332f609d6ddecb28be
parent8533d955f884f7b61d011a7c7d183a6c99db636b
tests: add test cases for inode badness

  LU-5949 e2fsck: simplify inode badness handling

  Move the badness increment into fix_problem() so that code does
  not need to be spread across the code and explicitly set.  Instead,
  take advantage of the fact that pctx->ino is almost always pointing
  at the bad inode and increment badness whenever fix_problem() is
  called on the inode.  This also handles new problems in the future.

  That leaves only a handful of places in the code that need special
  handling to either set a higher badness (e.g. inode blocks that are
  directly referencing filesystem metadata or have wildly incorrect
  timestamps), or should not contribute to inode badness at all.

  The main exceptions are when reprocessing duplicate blocks in the
  inode (badness already set), and cleaning bad entries in a directory
  leaf block in check_dir_block(), which uses pctx->ino to reference
  the parent directory inode number.  In such cases, fix_problem_bad()
  is called with 0 badness, since the leaf block was been repaired,
  and clearing the directory inode in this case is unnecessary.

  This patch should be merged into original badness patch on rebase.

  Fixes: 92a85a3ced2c ("e2fsck: track errors/badness found for each inode")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
  Change-Id: I96cd21b5976991f0bb1c63fc99857c80e23ebbe5
  Reviewed-on: https://review.whamcloud.com/41328
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Reviewed-by: Artem Blagodarenko <artem.blagodarenko@hpe.com>
Change-Id: Ie3f1f33a1e227cd241632e1506344f53788b3109
Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
tests/f_ibadness/expect.1 [new file with mode: 0644]
tests/f_ibadness/expect.2 [new file with mode: 0644]
tests/f_ibadness/image.gz [new file with mode: 0644]
tests/f_ibadness/name [new file with mode: 0644]
tests/f_ibadness/script [new file with mode: 0644]
tests/f_ibadness_bad_extents/expect.1 [new file with mode: 0644]
tests/f_ibadness_bad_extents/expect.2 [new file with mode: 0644]
tests/f_ibadness_bad_extents/image.gz [new file with mode: 0644]
tests/f_ibadness_bad_extents/name [new file with mode: 0644]
tests/f_ibadness_bad_extents/script [new file with mode: 0644]
tests/filter.sed