If the developer is running with SELinux enabled on /tmp, the
f_extent_htree regression test will fail because mke2fs by default
copies the extended attributes into the newly created file system (if
a directory hierarchy is specified via the -d option).
Fix this by adding a new extended option to mke2fs, -E no_copy_xattrs
and using it in f_extent_htree's test script.
Reported-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The f_extent_htree test depends on the "mke2fs -d" functionality
that did not exist in the maint branch when the patch was landed.
On master this functionality exists and should be used instead of
a pre-generated image. That exercises the "mke2fs -d" functionality
as well as e2fsck better.
[ Fixed to add missing expect.pre.? files --tytso ]
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Previously, e2fsck would exit with a status code of 1 even though the
only changes that it made to the file system were various
optimziations and not fixing file system corruption. Since the man
page states that an exit status of 1 means "file system errors
corrupted", fix e2fsck to return an exit status of 0.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The interim hack to allow this test to work for the maint branch ends
up leaving the tmpfile around. Clean this up.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
When an extent-mapped directory is compacted by "e2fsck -fD" and
frees enough leaf blocks that it loses an extent tree index block,
the old e2fsck_rehash_dir->ext2fs_block_iterate3->write_dir_block()
code would not free the extent block, which would result in the
extent tree becoming corrupted when it is written out.
Pass 1: Checking inodes, blocks, and sizes
Inode 17825800, end of extent exceeds allowed value
(logical block 710, physical block 570459684, len 1019)
This results in loss of a whole index block of directory leaf blocks
and maybe thousands or millions of files in lost+found.
Fix e2fsck_rehash_dir() to call ext2fs_punch() to free the blocks
at the end of the directory instead of trying to handle this itself
while writing out the directory. That properly handles all of the
cases of updating the extent tree as well as accounting for blocks
that are released (both leaf blocks and index blocks).
Add a test case for compacting the directory to be smaller than the
index block that originally caused the corruption.
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>