Whamcloud - gitweb
LU-14710 e2fsck: fix ".." more gracefully if possible 58/43858/3
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 28 May 2021 04:57:20 +0000 (22:57 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 31 May 2021 23:25:02 +0000 (23:25 +0000)
commit5aa781e24b9ce22049c8542daaf47a05027a1179
tree4b4e1e0b6bf7312b061b0b10c9ea44636ff61161
parent933bb7f7af88fe810bfd3a931d1a87e92826c174
LU-14710 e2fsck: fix ".." more gracefully if possible

If the "." entry is corrupted, it will be reset in check_dot().
It is possible that the ".." entry can be recovered from the
directory block instead of also resetting it immediately.  If
it appears that there is a valid ".." entry in the block, allow
that to be used, and let check_dotdot() verify the dirent itself.

When resetting the "." and ".." entries, use EXT2_FT_DIR as the
file type instead of EXT2_FT_UNKNOWN, to avoid extra problems
later can easily be avoided.

Fixup affected tests using the new "repair-test" script that
updates the expect.[12] files from $test.[12].log for the given
tests and re-runs the test to ensure it now passes.

Change-Id: Ia5e579bcf31a9d9ee260d5640de6dbdb60514823
Signed-off-by: Andreas dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/43858
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Artem Blagodarenko <artem.blagodarenko@hpe.com>
e2fsck/pass2.c
tests/f_baddotdir/expect.1
tests/f_baddotdir/expect.2
tests/f_baddotdir/image.gz
tests/f_dir_bad_csum/expect.1
tests/f_rebuild_csum_rootdir/expect.1
tests/f_resize_inode_meta_bg/expect.1
tests/f_uninit_dir/expect.1
tests/scripts/repair-test [new file with mode: 0755]