]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit - e2fsck/pass2.c
e2fsck: fix check of directories over 4GB
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 2 Feb 2021 08:25:49 +0000 (01:25 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 9 Feb 2021 03:40:42 +0000 (22:40 -0500)
commitf15b1aaf8f1241ac55057ec61a0d399147fc644b
tree9d341034465ca966b9417bbefe086e42e1ee54bc
parentd9844883a1148d58844a345abbd35b63321d9eeb
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.

Since it isn't very common to have directories this large, and
unlike sparse files that don't have ill effects if the size is
too large, an too-large directory will have all of the sparse
blocks filled in by e2fsck, so huge directories should still
be viewed with suspicion.  Check for consistency between two of
the three among block count, inode size, and superblock large_dir
flag before deciding whether the directory inode should be fixed
or cleared, or if large_dir 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>
Lustre-bug-id: https://jira.whamcloud.com/browse/LU-14345
Change-Id: I1b898cdab95d239ba1a7b37eb96255acadce7057
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
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