]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit - e2fsck/problem.h
e2fsck: set dir_nlink feature if large dir exists
authorAndreas Dilger <adilger@dilger.ca>
Fri, 22 Jun 2018 22:08:54 +0000 (18:08 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 22 Jun 2018 22:08:54 +0000 (18:08 -0400)
commit1a8015773a9316ee90f713c275fb3a38731735e4
tree0cf0538120d4faca5a099463d82f946532aedd78
parentc759616b8740a25e3e51e4add8df140514ff32ba
e2fsck: set dir_nlink feature if large dir exists

If there is a directory with more than EXT2_LINK_MAX (65000)
subdirectories, but the DIR_NLINK feature is not set in the
superblock, the feature should be set before continuing on
to change the on-disk directory link count to 1.

While most filesystems should have DIR_NLINK set (it was set
by default for all ext4 filesystems, and all kernels between
2.6.23 and 4.12 automatically set it if the directory link
count grew too large), it is possible that this flag is lost
due to disk corruption or for an upgraded filesystem.  We no
longer want kernels to automatically enable features.

Addresses: https://bugzilla.kernel.org/show_bug.cgi?id=196405
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass4.c
e2fsck/problem.c
e2fsck/problem.h
tests/f_large_dir/expect
tests/f_large_dir/script