Older e2fsck's would crash; e2fsck should now automatically retry
using the backup superblock if it is present.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The resize2fs tests, r_move_itable and r_resize_inode, were not
deleting the test.img tmpfile after completing the test.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
E2fsck currently only retries with the backup superblock if the
primary superblock is missing (e.g., overwritten with garbage). If
the superblock is just corrupted enough that it looks like ext2/3/4
superblock, but it is corrupt enough that ext2fs_open2() returns an
error, e2fsck stops without retrying. Let's fix this oversight.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The test in ext2fs_check_desc() is off by one; if the inode table
goes all the way to the last block of the block group, it will
falsely assert that it has extended past it. The last block
of a range is start + len -1, not start + len.
You can create (valid) filesystems that will cause e2fsck to complain
via one of the following mkfs commands:
mkfs.ext3 -F -b 1024 /dev/sdb1 2046000000
mke2fs -j -F -b 4096 -m 0 -N 5217280 /mnt/test/fsfile2 327680
mkfs.ext2 -F -b 1024 -m 0 -g 256 -N 3744 fsfile 1024
Addresses-Red-Hat-Bugzilla: #214765
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
For some odd geometries*, mkfs will try to allocate inode tables off
the end of the block group and fail, rather than warning that too
many inodes have been requested.
This is because when ext2fs_initialize calculates metadata overhead,
it is only adding in group descriptor blocks and the superblock
if the *last* bg contains them - but the first bg also has all of
the various metadata bits taking up space.
We need to calculate the overhead both for the first block group and
the last block groups separately, since the two different tests need
to know what the overheads are for those two cases, which may be
different.
*for example "mke2fs -b 1024 -m 0 -g 256 -N 3745 fsfile 1024"
(Note, the test here is a little funky; the expected output is
actually a mkfs failure - but a proper failure instead of the
allocator catching the problem at the last minute)
Addresses-Red-Hat-Bugzilla: #241767
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Recently, one of our customers found this message in pass2 of e2fsck
while doing some regression testing:
"Entry '4, 0x695a, 0x81ff, 0x0040, 0x8320, 0xa192, 0x0021' in ??? (136554) has
rec_len of 14200, should be 26908."
Both the displayed rec_len and the "should be" value are bogus. The
reason is that salvage_directory sets a offset beyond blocksize
leading to bogus messages.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
LC_ALL is the "high priority" environment variable that overrides all
others, where as LANG is the lowest priorty environment variable. If
LC_ALL is set, it doesn't matter whether LANG, LANGUAGE, LC_COLLATE,
LC_MESSAGES, and the all the rest are set. This will assure that the
locale when running the test suites is the "C" locale.
Obviates Gentoo patch: e2fsprogs-1.38-tests-locale.patch
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If the journal had been removed because it was corrupt, the
E2F_FLAG_JOURNAL_INODE flag will be set. If this flag is set, then
recreate the filesystem after checking the filesystem.
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
I think this is a small buglet in e2fsck: if a file has multiple hard
links, e2fsck pass1c search_dirent_proc() doesn't maintain its count
properly and may return DIRENT_ABORT before it has found containing
directories for all inodes sharing blocks.
Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
When patching and unpatching quilt files, empty directories get left
behind in the tests/ directory. Ignore them to avoid false test
failures.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This is probably only useful in artificial test cases, but it will be
useful if we ever do the "inodes in directory" idea for ext4.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If there is an orphaned inode whose '..' entry is pointing at a special
file, the filetype of the '..' entry will set to the type of the special
file. When the orphaned directory is reconnected to /lost+found, the
filetype of the '..' field is not reset to EXT2_FT_DIR, so a second
e2fsck is required to repair the filesystem.
We address this situation by setting the filetype of '..' when we
reconnect the inode to /lost+found.
Addresses Lustre Bug: #11645
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This is not yet ready to be used yet, but add it into the tree so that
future patches don't have to deal with manually adding this binary
image file into the tree.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The e2fsprogs and kernel implementation of directory hash tree has a
bug which causes the implementation to be dependent on whether
characters are signed or unsigned. Platforms such as the PowerPC,
Arm, and S/390 have signed characters by default, which means that
hash directories on those systems are incompatible with hash
directories on other systems, such as the x86.
To fix this we add a new flags field to the superblock, and define two
new bits in that field to indicate whether or not the directory should
be signed or unsigned. If the bits are not set, e2fsck and fixed
kernels will set them to the signed/unsigned value of the currently
running platform, and then respect those bits when calculating the
directory hash. This allows compatibility with current filesystems,
as well as allowing cross-architectural compatibility.
Addresses Debian Bug: #389772
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
- EXT4_FEATURE_RO_COMPAT_HUGE_FILE (0x0008) - change i_blocks to be
in units of s_blocksize units instead of 512-byte sectors, use
l_i_frag and l_i_fsize as i_blocks_hi (could also be part of 64BIT).
E2fsck and debugfs changed to support i_blocks_hi instead of l_i_frag and
l_i_fsize.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Create new ext2fs library inline functions in order to calculate
the starting and ending blocks in a block group.
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
When allocating space for the RAID filesystems with the stride parameter,
place each portion of the group's inode table right up after the superblock
(if present) in order to minimize fragmentation of the freespace.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Also, use this environtment variable to make sure that a local
/etc/e2fsck.conf file will not interfere with the regression test
suite.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Detect if the superblock's last mount field or last write field is in
the future, and offer to fix if so. (Addresses Debian Bug #327580)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add the --valgrind option to the tests/test_script which allows us to
run the e2fsprogs regression test suite under valgrind.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This was actually caused by two bugs. The first bug is that if the
inode has been fully fixed up, the code will attempt to remove the
inode from the inode_bad_map without checking to see if this bitmap is
present. Since it is cleared at the end of pass 2, if
e2fsck_process_bad_inode is called in pass 4 (as it is for
disconnected inodes), this would result in a core dump.
The first bug was mostly hidden by a second bug, which caused
e2fsck_process_bad_inode() to consider all inodes without an extended
attribute to be not fixed.
Note: This bug was introduced in e2fsprogs 1.36.
(Addresses Debian Bug: #316736)
easier to understand (sorry, translators).
Add new @m (multiply-claimed) and @n (invalid) expansions for e2fsck
problem descriptions.
Add Dutch translation, and update French translation.
Add an explanation of how the @-expansion and %-exapansion works in
e2fsck/problem.c to make life easier for the translators.
Synchronize and update po files.
f_swapfs, f_move_itable, f_resize_inode, test_config:
Allow the diff options to be set in test_config so that
diff -u can be used on platforms that have it. (To be
done: checking whether diff can support -u in the
configure script.)