Whamcloud - gitweb
LU-14345 e2fsck: fix check of directories over 4GB 85/41385/2
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 1 Feb 2021 21:55:06 +0000 (14:55 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 3 Feb 2021 07:43:01 +0000 (07:43 +0000)
commit71b74579b7e6c5cfe6af05b00e45c8a75fce0d61
tree6f8bd8f7b08a569cd1b0e86884f850b0eaae61ee
parentb46f7f0490c05d55e23474558859560a62bd054c
LU-14345 e2fsck: fix check of directories over 4GB

If directories grow larger than 4GB in size with the large_dir
feature, e2fsck will consider them to be corrupted and clear
the high bits of the size.  Previous checking appears to have
been done only beyond the prior 2GB directory size limit.

Since it isn't very common to have directories this large, and
unlike sparse files that don't have any ill effect if the size
is wrong, an overly-large directory will have all of the sparse
blocks filled in by e2fsck, so such directories should still
be viewed with suspicion.  Check for consistency between two of
the three block count, inode size, and superblock large_dir flag
before deciding whether the directory should be fixed or cleared,
or if the large_dir feature should be set in the superblock.

Update the f_recnect_bad test case to match new output.

Fixes: 49f28a06b738 ("e2fsck: allow to check >2GB sized directory")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I1b898cdab95d239ba1a7b37eb96255acadce7057
Reviewed-on: https://review.whamcloud.com/41385
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>
12 files changed:
e2fsck/e2fsck.c
e2fsck/e2fsck.h
e2fsck/message.c
e2fsck/pass1.c
e2fsck/pass2.c
e2fsck/problem.c
e2fsck/problem.h
lib/ext2fs/blknum.c
lib/ext2fs/expanddir.c
lib/ext2fs/punch.c
lib/ext2fs/res_gdt.c
tests/f_recnect_bad/expect.1