Commit Graph

572 Commits (master)

Author SHA1 Message Date
Theodore Ts'o 6c59a665da configure: fix --with-diet-libc
Newer versions of autoconf pull in AC_PROG_GCC as part of
AC_CANONICAL_HOST.  So we need check for WITH_DIET_LIBC earlier in
configure.in.

Also, e2fsprogs now needs functions which are found in diet libc's
compat library.  So add support for autoconf's LIBS function, and
automatically set libs to include -lcompat.

Finally, disable compiling e4defrag by deault if --with-diet-libc is
specified because the program has too many glibc dependencies.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-05 22:58:16 -05:00
Theodore Ts'o c32409aec6 e2fsck: improve the "superblock corrupt" message
Previously, this message used 8193 as the example alternate
superblock.  But for most file systems, the backup superblock is
located at 32768 (since most file systems have a block size of 4k, and
not 1k).

Addresses-Debian-Bug: #719185

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-04 19:11:30 -05:00
Theodore Ts'o 9c846766fd Merge branch 'maint' into next
Conflicts:
	RELEASE-NOTES
	debian/changelog
	version.h
2013-12-28 23:27:39 -05:00
Theodore Ts'o 9f90b2e632 tests: fix stray newline printed when running r_min_itable
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-26 00:37:09 -05:00
Theodore Ts'o 2ffccc82c4 Merge branch 'maint' into next
Conflicts:
	lib/ext2fs/csum.c
2013-12-26 00:30:56 -05:00
Phillip Susi 22b83f6280 e2image: perform in-place move
If given at least one offset and only one file, assume source
and dest are the same, and do an in place move.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-26 00:20:40 -05:00
Theodore Ts'o aafd361550 tests: use the in-tree binaries in the test f_extent_oobounds
Fix the f_extent_oobounds test so that it uses binaries built in the
tree, instead of the binaries in the system PATH (which might not
exist in a chroot environment) when creating the test image.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-24 22:50:23 -05:00
Andreas Dilger 2bc3041754 debugfs, e2fsck: fix s_desc_size handling
The s_desc_size in the superblock specifies the group descriptor
size in bytes, but in various places the EXT4_FEATURE_INCOMPAT_64BIT
flag implies that the descriptor size is EXT2_MIN_DESC_SIZE_64BIT
(64 bytes) instead of checking the actual size.  In other places,
the s_desc_size field is used without checking for INCOMPAT_64BIT.

In the case of ext2fs_group_desc() the s_desc_size was being ignored,
and assumed to be sizeof(struct ext4_group_desc), which would result
in garbage for any but the first group descriptor.  Similarly, in
ext2fs_group_desc_csum() and print_csum() they assumed that the
maximum group descriptor size was sizeof(struct ext4_group_desc).
Fix these functions to use the actual superblock s_desc_size if
INCOMPAT_64BIT.

Conversely, in ext2fs_swap_group_desc2() s_desc_size was used
without checking for INCOMPAT_64BIT being set.

The e2fsprogs behaviour is different than that of the kernel,
which always checks INCOMPAT_64BIT, and only uses s_desc_size to
determine the offset of group descriptors and what range of bytes
to checksum.

Allow specifying the s_desc_size field at mke2fs time with the
"-E desc_size=NNN" option.  Allow a power-of-two s_desc_size
value up to s_blocksize if INCOMPAT_64BIT is specified.  This
is not expected to be used by regular users at this time, so it
is not currently documented in the mke2fs usage or man page.

Add m_desc_size_128, f_desc_size_128, and f_desc_bad test cases to
verify mke2fs and e2fsck handling of larger group descriptor sizes.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-24 22:50:19 -05:00
Andreas Dilger fd5e00e1d0 tests: delete temporary resize test files
Since commit 5ad07acad if $TMP cannot hold large test filesystems
for resize testing the resize_test creates temporary test files
in the local working directory.  Since it overrides TMPFILE locally
the calling program does not delete the generated file correctly.

Delete the large $TMPFILE within resize_test if it passes, but leave
it for debugging if the test failed.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-23 16:01:56 -05:00
Theodore Ts'o 2fae17697a Merge branch 'maint' into next
Conflicts:
	e2fsck/pass2.c
	e2fsck/pass3.c
2013-12-03 00:24:39 -05:00
Andreas Dilger 5ad07acadc tests: check backing filesystem can handle large file
The new resize tests create 2TB test files, but tmpfs in kernels
before 3.1 have a max file size of 256GB.  Ext3 may also have
a size limit for smaller blocksize filesystems.

Fix the resize_test script to verify that $TMPFILE can be resized
to the final test size, and if that fails try creating the file on
the local filesystem instead of in $TMPDIR.  If that cannot hold
the large filesystem, skip the test.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Tested-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-12-03 00:11:55 -05:00
Theodore Ts'o 1586850bcd Merge branch 'maint' into next 2013-10-14 09:57:23 -04:00
Niu Yawei 43075b42bd quota: fix disabling quota, add quota tests
Update all superblock copies when disabling the quota feature.

Added basic tests for the quota feature.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-10-14 09:54:28 -04:00
Theodore Ts'o e7619b71c0 tests: add new test t_uninit_bg_rm
This test checks tune2fs's support for removing the uninit_bg feature
flag.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-10-12 23:08:02 -04:00
Theodore Ts'o e337e7fad8 Merge branch 'maint' into next
Conflicts:
	e2fsck/problem.c
	e2fsck/rehash.c
	e2fsck/super.c
2013-10-12 22:26:28 -04:00
Theodore Ts'o 128c943ef2 tests: remove version number dependency in r_min_itable
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-10-12 22:25:29 -04:00
Darrick J. Wong 832cb612f8 e2fsprogs: add (optional) sparse checking to the build
Run sparse against source files when building e2fsprogs with 'make C=1'.  If
instead C=2, it configures basic ext2 types for bitwise checking with sparse,
which can help find the (many many) spots where conversion errors are
(possibly) happening.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-10-11 23:12:40 -04:00
Theodore Ts'o 7447da02f0 tests: add test for resize2fs -M with inode table in middle of block group
Eric Sandeen reported that Fedora's mke2fs when compiled for ppc was
creating a file system which caused problems with resize2fs -M.
Closer examination showed that the problem was file system which
looked like this:

Filesystem features:      ext_attr dir_index filetype sparse_super
Inode count:              512
Block count:              1247
   ...

Group 0: (Blocks 1-1024)
  Primary superblock at 1, Group descriptors at 2-2
  Block bitmap at 66 (+65), Inode bitmap at 67 (+66)
  Inode table at 68-99 (+67)

Group 1: (Blocks 1025-1246)
  Backup superblock at 1025, Group descriptors at 1026-1026
  Block bitmap at 1090 (+65), Inode bitmap at 1091 (+66)
  Inode table at 1092-1123 (+67)

It's not obvious to me why Fedora's ppc mke2fs is creating file
systems like this (I can't reproduce this on debian ppc systems), but
resize2fs -M should be able to deal with such file systems, which is
what this test is designed to check.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-09-30 23:07:27 -04:00
Eric Whitney d45170717a tests: add another test for uninit extents past eof
Commit d3f32c2db8 was intended to detect extents found outside their
proper location in the extent tree, including invalid extents at the
end of an extent block.  However, it incorrectly reported legal
uninitialized extents created by fallocate() at the end of file with
the FALLOC_FL_KEEP_SIZE flag as false positives.  xfstests
generic/263 (among others) caught this problem, while the e2fsprogs
test f_uninit_ext_past_eof did not.  The latter test failed to
detect the problem in part because it uses a test file whose i_size
is 0.

Add a test derived from the fsx-based test case in xfstests
generic/263 consisting of a file with non-zero length, more than
four extents total, and two uninitialized extents past EOF to
reliably reproduce commit d3f32c2db8's false positive behavior.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-09-26 20:17:09 -04:00
Theodore Ts'o fc9f162eea Merge branch 'maint' into next 2013-09-09 20:49:49 -04:00
Theodore Ts'o c8ec2bad18 e2fsck: correctly deallocate invalid extent-mapped symlinks
The function deallocate_inode() in e2fsck/pass2.c was buggy in that it
would clear out the inode's mode and flags fields before trying to
deallocate any blocks which might belong to the inode.

The good news is that deallocate_inode() is mostly used to free inodes
which do not have blocks: device inodes, FIFO's, Unix-domain sockets.

The bad news is that if deallocate_inode() tried to free an invalid
extent-mapped inode, it would try to interpret the root of the extent
node as block numbers, and would therefore mark various file system
metadata blocks (the superblock, block group descriptors, the root
directory, etc.) as free and available for allocation.  This was
unfortunate.

(Try running an older e2fsck against the test file system image in the
new test f_invalid_extent_symlink, and then run e2fsck a second time
on the fs image, and weep.)

Fortunately, this kind of file system image corruption appears to be
fairly rare in actual practice, since it would require a very unlucky
set of bits to be flipped, or a buggy file system implementation.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-07-28 22:03:01 -04:00
Theodore Ts'o dd50ef8743 e2fsck: check extent-mapped directories with really large logical blocks
E2fsck was missing a check for directories with logical blocks so
large that i_size > 2GB.  Without this check the test image found in
the new test f_toobig_extent_dir will cause e2fsck to die with a
memory allocation failure:

Error storing directory block information (inode=12, block=0, num=475218819): Memory allocation failed
e2fsck: aborted

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reported-by: Andrey Melnikov <temnota.am@gmail.com>
2013-07-28 21:03:00 -04:00
Theodore Ts'o 38cc555a5f Merge branch 'maint' into next 2013-07-08 12:14:45 -04:00
Theodore Ts'o 42b61c50e5 libext2fs, tests: allow /etc/mtab file to be missing
The environment variable EXT2FS_NO_MTAB_OK will suppress the error
code EXT2_NO_MTAB_FILE when the /etc/mtab file can not be found.  This
allows the e2fsprogs regression test suite to be run in chroots which
might not have an /etc/mtab file.

By default will still want to complain if the /etc/mtab file is
missing, since we really don't want to discourage distributions and
purveyors of embedded systems from running without an /etc/mtab file.
But if it's missing it only results in a missing sanity check that
might cause file system corruption if the file system is mounted when
programs such as e2fsck, tune2fs, or resize2fs is running, so there is
no potential security problems that might result if this environment
variable is set inappropriately.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-07-08 12:08:44 -04:00
Theodore Ts'o 8b9eb12807 Merge branch 'maint' into next
Conflicts:
	RELEASE-NOTES
	e2fsck/Makefile.in
	lib/config.h.in
	version.h
2013-06-16 18:54:01 -04:00
Andreas Dilger dc9cc7006a mke2fs: don't set root dir UID/GID automatically
Don't change the root directory's UID/GID automatically just because
mke2fs was run as a non-root user.  This can be confusing for users,
and is not flexible for non-root installation tools that need to
create a filesystem with different ownership from the current user.

Add the "-E root_owner[=uid:gid]" option to mke2fs so that the user
and group can be explicitly specified for the root directory.  If
the "=uid:gid" argument is not specified, the current UID and GID
are extracted from the running process, as was done in the past.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-06-15 21:51:33 -04:00
Andreas Dilger 2a83b3c374 mke2fs: sort option parsing, deprecate "-R"
A minor cleanup to order the command-line option parsing in
alphabetical order, except for "-E" and "-R", which need to
be co-located.

Print a message that the "-R" option is deprecated.  It has
been deprecated since 2005 (commit c6a44136b9).

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-06-15 18:47:30 -04:00
Andreas Dilger f9fd342e56 tests: clean up sed filtering of test output
The sed filters for test outputs that are used to remove build and
test specific information (such as version strings, dates, times,
UUIDs) were unconditionally deleting the first line of output.  This
would normally contain the tool version string, but in some cases
contained other information that was being lost.  This can lead to
difficulty debugging test failures.

The sed filtering has been changed to only remove the actual version
strings.  As well, similar filter strings were duplicated throughout
many scripts, and "sed" and "tr" were often called multiple times in
a pipeline.  These have been consolidated into a single filter.sed
file to avoid having to maintain these filters in multiple places.

In a few cases, accidentally deleted messages have been restored to
the expect output for the tests.  In other cases, trivial whitespace
has been changed in the expect files.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-06-15 18:44:09 -04:00
Theodore Ts'o e07b71f294 Merge branch 'maint' 2013-06-08 17:02:54 -04:00
Theodore Ts'o e2e389a1d5 tests: add new test f_extent_oobounds
This tests creates a file system where the last entry in one leaf
block overlaps with logical block range in the first entry of the next
leaf block.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-06-06 23:53:31 -04:00
Theodore Ts'o 29f6dfea52 Merge branch 'maint' into next 2013-05-16 11:05:37 -04:00
Theodore Ts'o 5dfd5ef88d tests: add new test f_zero_xattr
E2fsck previously was complaining with zero-length extended attributes
if they appeared in the in-inode xattr space.  Test to make sure
e2fsck is now happy with such xattrs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-04-25 00:29:09 -04:00
Theodore Ts'o 07bcd90f3d Merge branch 'maint' into next 2013-04-22 00:07:08 -04:00
Theodore Ts'o 9bd95a472c crcsum: remove the -b option since ext2fs_crc32c_be is dropped in 1.43.x
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-04-22 00:04:36 -04:00
Theodore Ts'o e79a9395b3 tests: add more tests for off-line resizing
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-03-31 20:41:23 -04:00
Theodore Ts'o 28e6662403 tests: create crcsum progam to support resizing tests
The only checksum program which we can reliably count upon being
installed on all systems is "sum", which is not a particular robust
checksum.  The problem with using md5sum or sha1sum is it hat it may
not be installed on all systems.  So create a crcsum program which is
used so we can validate that a data file on a resized file system has
not been corrupted.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-03-31 20:41:23 -04:00
Theodore Ts'o 7b68fa38b8 Merge branch 'maint' into next
Conflicts:
	RELEASE-NOTES
	lib/ext2fs/ext2_err.et.in
	version.h
2013-01-16 14:14:09 -05:00
Theodore Ts'o 390e49aab7 tests: create test for debugfs creating special files
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-01-16 14:09:20 -05:00
Theodore Ts'o ab83252174 Merge branch 'maint' into next
Conflicts:
	e2fsck/problem.c
	e2fsck/problem.h
2012-12-24 10:50:20 -05:00
Theodore Ts'o b4944f654c tests: add test of an incorrect interior node in an extent tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-12-20 21:48:08 -05:00
Theodore Ts'o 2f2a048b1d Merge branch 'maint' into next 2012-09-22 21:35:46 -04:00
Theodore Ts'o c498cb11d3 mke2fs: fix progress suppression to make regression tests reliable
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-09-22 21:26:48 -04:00
Theodore Ts'o 43c67c4f73 Merge branch 'maint' into next
Conflicts:
	debian/changelog
	version.h
2012-09-21 12:55:45 -04:00
Theodore Ts'o b2f5ce5516 mke2fs: throttle allocating groups progress as well
Throttle updates for the "Allocating Groups" progress updates to once
a second as well.  We now do this throttling in libext2fs, so we don't
have to do this for each of mke2fs's progress updates, and because the
updates from ext2fs_allocate_tables() come from within libext2fs
anyway.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-09-21 12:50:04 -04:00
Theodore Ts'o 32dd6cdbe5 Merge branch 'maint' into next
Conflicts:
	resize/resize2fs.c
2012-09-16 22:06:29 -04:00
Andreas Dilger 12f48b0caa tests: kill debugfs on interrupted MMP test
If the f_mmp test is interrupted during its test run, then it can
leave debugfs busy-looping in the background.  Since f_mmp is a
relatively long-running test, and is likely to be running during
a parallel test run, this can happen fairly often.

Set a signal trap for the f_mmp test script being killed, so that
the background debugfs command will always be killed by the test.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-09-16 22:05:21 -04:00
Theodore Ts'o a3e87bcc32 mke2fs: disable progress reporting in mke2fs.conf for regression tests
Add a configuration knob so the regression tests can disable progress
reporting.  This fixes a potential lack of predictability since the
progress reports are now time based (once a second) which is
problematic for regression tests which are comparing the expected
output of mke2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-09-16 20:43:07 -04:00
Andreas Dilger 03b10639e7 tests: remove unused temporary files for MMP tests
The MMP tests need to be run on a real disk instead of tmpfs, since
the MMP block access is using O_DIRECT.  As such, they create their
own test files in the local testing directory instead of using the
temporary file created in /tmp by the test_one script.  Delete the
tempfs file before clobbering TMPFILE, otherwise it will leave the
unused file in /tmp after the test is completed.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-08-15 16:44:59 -04:00
Andreas Dilger ff07d436fc tests: allow e2fsck tests to run on OS/X
The "mktemp" program requires a template on OS/X.  Allow the test
TMPFILE to be created in the local /tmp directory for both OS/X
and Linux.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-06-12 13:59:56 -04:00
Theodore Ts'o e130a16e83 tests: add two more tests of orphaned inode handling
Add two tests, f_orphan_indirect_inode, and f_orphan_extents_inode,
which tests the bug fixes in the two previous commits:

e2fsck: update global free blocks/inodes count when truncating orphan inodes
libext2fs: fix block iterator for extents when truncating inodes

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-06-12 01:38:57 -04:00
Tao Ma 8d12c46a22 tests: add new test f_zero_extent_length
If all of the extents in the last extent tree block (ETB) in a
non-trivial extent tree contain uninitialized extents which are after
the end of the file as defined by i_size, the hueristics will
incorrectly estimate the last entry (and hence the node's e_len field)
in the last entry of each level of the extent tree.

As Tao Ma has noted, since e2fsck was requiring that the length
(e_len) field of interior nodes be non-zero, this was causing false
failures where e2fsck would declare that the extent tree was
corrupted.

This was fixed in commit 9c40d14841: "e2fsck: only check for
zero-length leaf extents".  Add a regression test case to ensure that
this issue remains fixed.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-06-11 01:06:50 -04:00
Theodore Ts'o eb92f5741f tests: fix the e2fsck test script to handle a missing test name
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-31 20:13:51 -04:00
Theodore Ts'o be1b8c6fe8 tests: add new test to validate errno handling in the journal superblock
Add a new regression test f_jnl_errno

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-31 20:12:35 -04:00
Andreas Dilger f3331df6bb tests: use make rules to run tests in parallel
Change the e2fsck/mke2fs/tune2fs/e2image/debugfs regression tests to
be driven by Makefile rules instead of by a script loop.  This allows
the tests to be run in parallel like a build and reduces testing time
significantly.

One major change to the tests themselves is to printing the test name,
description, and status together after the test has passed or failed,
to avoid mixing lines from the tests.  The other major change is to
use unique temporary filenames for each test, which was mostly handled
already via b4db1e4c74, but in some
cases temporary files are changed to use $test_name.tmp to avoid any
collision between running tests.

On my old 2-CPU system it reduced the testing time from 160s to 40s.
Much of the savings is from the MMP test delays running in parallel.
It still takes the time of the slowest test, f_mmp_garbage, though
there will be ongoing benefit in the future as more tests are added
since the wallclock time will not increase linearly for each test.

Tests were run with various combinations of "make -j", and "make -j2"
through "make -j44" repeatedly without any test failures.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-05-29 08:41:26 -04:00
Theodore Ts'o 108e6581fc tests: fix f_jnl_64bit so that it actually has a 64-bit journal
The previous image did not have a 64-bit journal so it wouldn't
properly test the 64-bit journal format.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-21 11:03:16 -04:00
Matthias Andree 21af16f404 Fix bashisms
These break the self-test suite on *BSD, and on some Linux distros
where /bin/sh is not implemented by bash.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-05-11 22:13:21 -04:00
Theodore Ts'o 65ee799fbe tests: add new tests f_jnl_32bit and f_jnl_64bit
Add regression tests which make sure e2fsprogs understands the current
32-bit and 64-bit journal format.  If a patch breaks the on-disk
format, these tests should warn us about that.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-02 16:28:48 -04:00
Theodore Ts'o 7a069f1ca9 tests: add new test f_eofblocks
Since we have changed the eofblocks handling in e2fsck (by removing
the need for the EOFBLOCKS_FL flag), we should have a test to check
out how we handle uninitialized and initialized blocks which are exist
beyond i_size, with files that have (and don't have) the EOFBLOCKS_FL.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-10 23:50:37 -04:00
Lukas Czerner 010dc7b90d e2fsck: remove EXT4_EOFBLOCKS_FL flag handling
We've decided to remove EOFBLOCKS_FL from the ext4 file system entirely,
because it is not actually very useful and it is causing more problems
than it solves. We're going to remove it from e2fsprogs first and then
after the new e2fsprogs version is common enough we can remove the
kernel part as well.

This commit changes e2fsck to not check for EOFBLOCKS_FL. Instead we
simply search for initialized extents past the i_size as this should not
happen. Uninitialized extents can be past the i_size as we can do
fallocate with KEEP_SIZE flag.

Also remove the EXT4_EOFBLOCKS_FL from lib/ext2fs/ext2_fs.h since it is
no longer needed.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-03-22 19:42:11 -04:00
Theodore Ts'o 010c49cf49 e2fsck: report ext2fs_open2() and ext2fs_check_desc() errors
Print the actual errors returned by ext2fs_open2() and
ext2fs_check_desc() before we fall back to the backup block group
descriptors so that it's easier to see if there is some obscure
failure that is causing e2fsck to think that it should use the backup
block group descriptors.

Addresses-Google-Bug: #6208183

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-03-21 23:40:24 -04:00
Andreas Dilger 0f30deb3b0 tests: have "make testnew" target use local mke2fs
The "make testnew" target in the tests/ subdirectory (used to
help create new test cases) should use the locally-built mke2fs
binary instead of the installed system binary, to avoid cases
where the system binary does not support some new functionality
being tested.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-03-18 23:48:45 -04:00
Theodore Ts'o b9a64a519a e2fsck: print the current and expected block group checksums
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-03-15 19:29:19 -04:00
Theodore Ts'o 26c09eb814 e2fsck: check for zero length extent
If an extent has e_len set to zero, the kernel will oops with a
BUG_ON.  Unfortunately, e2fsck wasn't catching this case.  The kernel
needs to be fixed to notice this case and call ext4_error() instead of
failing an assertion check, but e2fsck should catch this case and
repair it (by deleting the errant extent).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-03-11 23:31:38 -04:00
Andreas Dilger 454ac9d56a libext2fs: quiet spurious group checksum errors
If we have to read the backup group descriptor checksums, the UNINIT
flags are cleared to ensure that all of the inodes in the filesystem
are scanned.  However, the code that reset the UNINIT flags did not
reset the group checksum, and this produced many spurious error
messages in e2fsck.

Group descriptor 0 checksum is invalid.  FIXED.
Group descriptor 1 checksum is invalid.  FIXED.
:
:

Recompute checksums after modifying group descriptors to avoid these
error messages.  Remove expected error messages in f_illitable_flexbg.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-02-07 21:11:21 -05:00
Theodore Ts'o 1f572d1f88 libext2fs: display partial path if fs corrupted in ext2fs_get_pathname()
The function ext2fs_get_pathname() used to return EXT2_ET_NO_DIRECTORY
if one of the directories in an inode's pathname is not a directory.
This is not very useful in an emergency, when the file system is
corrupted.  This commit will cause ext2fs_get_pathname() to return a
partial pathname, which should help system administrators trying to
use debugfs to investigate a corrupted file system.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-01-17 15:38:31 -05:00
Theodore Ts'o 499d5ec558 Update Release Notes, Changelogs, version.h, etc. for 1.42 release
Also fixed depfix.sed

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-11-29 16:48:14 -05:00
Theodore Ts'o ebd0a16a24 tests: add test case for multiply claimed blocks with bigalloc
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-11-28 11:03:08 -05:00
Eric Sandeen 6d26887991 tests: fix mmp tests on hard 4k devices
Several of the mmp tests were failing on an s390 guest because
direct IO cannot be done on sub-sector sizes, and they were
doing 1k IOs to files on a 4k logical/physical device.

A few tests could just be changed to 4k, but others
needed fixed up output as well.

With this I have all tests passing on s390 again.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-11-11 21:11:43 -05:00
Theodore Ts'o 0c80c44bd0 libext2fs: ext2fs_[set_]file_acl_block needs to check for 64-bit feature flag
The ext2fs_file_acl_block() and ext2fs_set_file_acl_block() needs to
only check i_file_acl_high if the 64-bit flag is set.  This is needed
because otherwise we will run into problems on Hurd systems which
actually use that field for h_i_mode_high.

This involves an ABI change since we need to pass ext2_filsys to these
functions.  Fortunately these functions were first included in the
1.42-WIP series, so it's OK for us to change them now.  (This is why
we have 1.42-WIP releases.  :-)

Addresses-Sourceforge-Bug: #3379227

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-10-16 20:46:49 -04:00
Theodore Ts'o 86db36abfb e2fsck: avoid unnecessary reboots in some cases when checking the root fs
If e2fsck modifies certain superblock fields which the kernel doesn't
look at, mark the superblock as dirty without marking the file system
as changed.  This will avoid e2fsck signalling the init scripts that a
reboot is necessary.  This is safe, because the kernel doesn't
actually look at these superblock fields.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-30 23:12:37 -04:00
Theodore Ts'o 96a8afa7c1 e2fsck: check for invalid bad block inode
In some cases the bad block inode gets corrupted.  If it looks insane,
offer to clear it before trying to interpret it does more harm than
good.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-28 18:34:33 -04:00
Andreas Dilger d9c60e04b3 e2fsck: regression tests for INCOMPAT_MMP feature
Add tests for the MMP feature - creating a filesystem with mke2fs
and MMP enabled, enable/disable MMP with tune2fs, disabling the
e2fsck MMP flag with tune2fs after a failed e2fsck, and e2fsck
checking and fixing a corrupt MMP block.

The MMP tests need to be run from a real disk, not tmpfs, because
tmpfs doesn't support O_DIRECT reads, which MMP uses to ensure
that reads from the MMP block are not filled from the page cache.
Using a local disk does not slow down the tests noticably, since
they wait to detect if the MMP block is being modified.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-25 01:55:28 -04:00
Andreas Dilger d90d6a7146 tune2fs: kill external journal if device not found
Continue to remove the external journal device even if the device
cannot be found.

Add a test to verify that the journal device/UUID are actually removed
from the superblock.  It isn't possible to use a real journal device
for testing without loopback devices and such (it must be a block device)
and this would invite complexity and failures in the regression test.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-24 14:34:47 -04:00
Theodore Ts'o d1154eb460 Shorten compile commands run by the build system
The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and
this was starting to cause some tools heartburn.  It also made "make
V=1" almost useless, since trying to following the individual commands
run by make was lost in the noise of all of the defines.

So fix this by putting the configure-generated defines in lib/config.h
and the directory pathnames to lib/dirpaths.h.

In addition, clean up some vestigal defines in configure.in and in the
Makefiles to further shorten the cc command lines.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-18 17:34:37 -04:00
Eric Sandeen 2bf0739dc0 test_icount: fclose() before exit
Just to be tidy.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-16 19:55:55 -04:00
Lukas Czerner 2fa1679adb tests: Print out list of failed tests
Currently we need to grep, list or just search for failed tests when
running 'make check' which is annoying. This commit simply prints out
the list of failed test names at the end of the output.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-15 23:54:49 -04:00
Lukas Czerner d2bfdc7ff1 e2fsprogs: Use punch hole as "discard" on regular files
If e2fsprogs tools (mke2fs, e2fsck) is run on regular file instead of
on block device, we can use punch hole instead of regular discard
command which would not work on regular file anyway. This gives us
several advantages. First of all when e2fsck is run with '-E discard'
parameter it will punch out all ununsed space from the image, hence
trimming down the file system image. And secondly, when creating an
file system on regular file (with '-E discard' which is default), we
can use punch hole to clear the file content, hence we can skip inode
table initialization, because reads from sparse area returns zeros. This
will result in faster file system creation (without the need to specify
lazy_itable_init) and smaller images.

This commit also fixes some tests that would fail due to mke2fs showing
discard progress, hence the output would differ.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-15 23:49:20 -04:00
Lukas Czerner faa2dcdad0 mke2fs: Use ext2fs_flush() only once
We are doing ext2fs_flush() twice right now at the end of the mke2fs.
First by directly calling ext2fs_flush() which is intended to write
superblock and fs accounting information. And then it is invoked again
when we are calling ext2fs_close(), only this time, because the fs is
not dirty, we are writing out only superblock.

I think it is bad to call it twice because even when writing only super
block it takes some time on bigger file systems and moreover
ext2fs_close() can fail without any reasonable explanation for the user.
Also ext2fs_flush() is printing out progress and it is confusing for the
users.

Fix all this by removing the ext2fs_flush() and leaving it all to
ext2fs_close(). However we need to introduce new variables to store
check interval and max mount count, because fs structure is freed on
ext2fs_close() and we really want to print those information as the last
info for the user.

[ Fixed type mismatch in a printf format statement -tytso]

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-13 22:42:19 -04:00
Theodore Ts'o 906a1cf9b6 tests: skip tests that require debugfs if debugfs has not been built
Avoid lots of tests failing if e2fsprogs is compiled with
--disable-debugfs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-03 10:04:37 -04:00
Theodore Ts'o f305fd7f0c tests: fix i_e2image so it works with valgrind
Since e2image can be optionally compiled out, we tested to see if
e2image was built; but using "test -x $E2IMAGE" fails if e2image is
something like "valgrind --simhints=lax-ioctls ../misc/e2image".
Define and use $E2IMAGE_EXE, much like we have done with e2undo and
resize2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-03 10:02:34 -04:00
Theodore Ts'o 92122d324d tests: add missing m_mkfs_overhead/expect
This file was accidentally dropped during the recent tests /tmp
overhual.  Re-adding.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-07-12 15:22:14 -04:00
Theodore Ts'o b4db1e4c74 tests: use /tmp for scratch files
The /tmp directory is often a memory based file system, and using this
can speed up running the regression test suite.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-07-09 12:08:10 -04:00
Theodore Ts'o a3efe48420 e2fsck: fix mysterious "FILE SYSTEM WAS MODIFIED" with no changes
Commit 2a77a784a3 (firest released in e2fsprogs 1.33) compared
superblock summary free blocks and inode counts with the allocation
bitmap counts before starting the file system check proper, and if
they differed, set the superblock and marked it as dirty.  If no other
file systme changes were required, this would cause a "*** FILE SYSTEM
WAS MODIFIED ***" message without any explanation of what e2fsck had
changed.

We fix this by only setting the superblock summary free block/inodes
counts if we are skipping a full check, and in non-preen mode, e2fsck
will now print an explicit message stating how the superblock had been
updated.

In a full check, any updates to the superblock free blocks/inodes
fields will be noted in pass5.

This change requires changing a few test results (essentially
reversing the changes made in commit 2a77a784a3).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-16 01:22:02 -04:00
Theodore Ts'o 8f36e6925f Merge branch 'maint' into next 2011-06-11 12:55:26 -04:00
Andreas Dilger 177cb5c7e2 e2fsprogs: ignore generated files for "git status"
Ignore files generated by "make" or "make check" in "git status".
Ignore backup files from editing files and generated tags files.
Delete a temporary file in tests/d_loaddump/script at test cleanup.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-06-11 12:51:44 -04:00
Andreas Dilger 9b4d06b8de mke2fs: add extent-mapped journal regression test
All of the regression tests in e2fsprogs still use a block-mapped
journal (if any journal at all).  Add a simple regression test that
tests extent-mapped journals for both mke2fs and e2fsck.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-06-11 12:22:36 -04:00
Andreas Dilger ec50834203 mke2fs: add test for large journal with lazy init
Add test for internal journal over 4GB in size, using the
lazy_journal_init and lazy_itable_init features.  Otherwise
the filesystem metadata would be too large to reliably run on
test systems, and take too long to create/check the filesystem.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-06-11 12:19:25 -04:00
Lukas Czerner 9e713505ab tests: New i_e2image test to validate image creation/conversion
This commit adds new regression test called i_e2image which should
validate expected behaviour of e2image raw and qcow2 image creation
and qcow2 -> raw image conversion. You can run it with "make check" as
the rest of regression tests.

Testing is performed on three filesystem images with different block
sizes (1024, 2048, 4096). It creates raw and qcow2 images from the
original and then convert qcow2 image back to raw image. The results are
checksummed and compared with pre-prepared results. All md5sums should
stay the same and raw image created from original and qcow2 image should
be the same as well (just for the record).

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-18 12:19:41 -04:00
Aditya Kali d3859af33f mke2fs: Allow specifying reserved_ratio via mke2fs.conf
This patch adds support for specifying 'reserved_ratio' (percent blocks
reserved for super user, same as '-m' command line option) in mke2fs.conf.
It adds profile_get_double function in profile.c that allows reading
floating point values from profile files.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-14 23:34:48 -04:00
Theodore Ts'o 214580a339 Merge branch 'maint' into next
Conflicts:
	misc/mke2fs.conf.5.in
2011-02-20 21:54:43 -05:00
Eric Sandeen 6a426c97ec e2fsprogs: enable user namespace xattrs by default
User namespace xattrs are generally useful, and I think extN
is the only filesystem requiring a special mount option to
enable them, when xattrs are otherwise available.  So this
change sets that mount option into the defaults, via a
mke2fs.conf option.

Note that if xattrs are config'd off, this will lead to a
mostly-harmless:

   EXT4-fs (sdc1): (no)user_xattr options not supported

message at mount time...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-02-20 21:36:26 -05:00
Eric Sandeen 3daf592646 e2fsprogs: turn off enforced fsck intervals by default
The forced fsck often comes at unexpected and inopportune moments,
and even enterprise customers are often caught by surprise when
this happens.  Because a filesystem with an error condition will
be marked as requiring fsck anyway, I submit that the time-based
and mount-based checks are not particularly useful, and that
administrators can schedule fscks on their own time, or tune2fs
the enforced intervals if they so choose.  This patch disables the
intervals by default, and I've added a new mkfs.conf option to
turn on the old behavior of random, unexpected, time-consuming
fscks at boot time.  ;)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-02-20 20:45:12 -05:00
Theodore Ts'o da2a5a4bae Merge branch 'maint' into next
Conflicts:
	resize/resize2fs.c
2010-12-22 19:00:21 -05:00
Theodore Ts'o a4fdf09414 libext2fs: Don't use the extended rec_len encoding for standard file systems
If the file system has a blocksize less than 64k, then don't use the
extended rec_len encoding, to be consistent with what the kernel will
do.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-12-22 13:53:02 -05:00
Theodore Ts'o 0358c9f9a4 Merge branch 'maint' into next
Conflicts:
	e2fsck/pass4.c
	misc/dumpe2fs.c
	resize/online.c
2010-12-13 09:16:09 -05:00
Theodore Ts'o e994dc99fe Disable lazy inode table initialization when running regression tests
This avoids test failures when running on new kernels that allow lazy
itable initialization.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-22 16:16:05 -05:00
Theodore Ts'o db0bdb49f4 Merge branch 'maint' into next
Conflicts:
	resize/extent.c
2010-07-19 02:37:41 -04:00
Mike Frysinger b887f08f95 e2freefrag: Fix getopt bug on machines with unsigned chars
The getopt() function returns an int, not a char.  On systems where the
default char is unsigned (like ppc), we get weird behavior where -1 is
truncated to 0xff but compared to (int)-1.

Also fix this same bug for two test programs, test_rel and iscan,
which aren't currently used at the moment.

Addresses-Gentoo-Bug: #299386

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-07-05 14:53:58 -04:00
Theodore Ts'o 97d26ce9e3 Merge branch 'maint' into next
Conflicts:
	e2fsck/journal.c
	e2fsck/pass1.c
	e2fsck/pass2.c
	misc/mke2fs.c
2010-06-07 12:42:40 -04:00
Theodore Ts'o edc1894e60 tests: Use our own mke2fs.conf file
Use a standard, fixed mke2fs.conf file so that if downstream
distributions want to change the mke2fs.conf which is distributed in
the RPM or dpkg file, it won't screw up the regression tests.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-14 20:18:11 -04:00
Theodore Ts'o 53499e86c5 tests: Add new test f_unused_itable
Add test to make sure e2fsck doesn't end up detaching and sending to
lost+found inodes which are in an bg_itable_unused_region (e.g. if
there was a power failure and bg_itable_unused wasn't updated because
journaling wasn't enabled).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-11 21:10:12 -04:00
Theodore Ts'o 2291fbb035 e2fsck: Check for cases where EOFBLOCKS_FL is unnecessarily set
Some kernels will crash if EOFBLOCKS_FL is set when it is it not
needed, and this if it is left set when it isn't needed, it is a sign
of a kernel bug.

Addresses-Google-Bug: #2604224

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-10 10:29:14 -04:00
Theodore Ts'o c5b23f6c0e Merge branch 'maint' into next 2010-03-15 18:53:45 -04:00
Theodore Ts'o ec65fa57a6 tests: Add new test f_rehash_dir
Add a new test which tests to make sure e2fsck -D works correctly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:14:12 -04:00
Theodore Ts'o 2d07b3ad98 Merge branch 'maint' into next
Conflicts:
	configure
	lib/ext2fs/alloc_tables.c
	misc/mke2fs.c
2010-01-31 18:49:08 -05:00
Theodore Ts'o 785f939046 tests: Add new test f_holedir2
This tests e2fsck's handling of both direct and extent-mapped
directoris containing holes when the i_size is 0.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 01:28:14 -05:00
Theodore Ts'o f4e14505ed e2fsck: Don't rehash directories which can fit in a single directory block
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 01:22:44 -05:00
Theodore Ts'o b71e01835f e2fsck: Fix duplicate directory entries for non-indexed directories
Duplicate directory entries were not necessarily getting found and
fixed for non-indexed directories, since we were sorting these
directories by inode number, and the duplicate entry code assumed the
entries were getting sorted by name or directory name hash.

Addresses-Sourceforge-Bug: #2862551

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-16 21:56:24 -05:00
Theodore Ts'o 95bcea9fc1 Merge branch 'maint' into next
Conflicts:
	configure
	configure.in
	misc/mke2fs.c
2009-10-04 20:40:46 -04:00
Theodore Ts'o 695706ca21 e2fsck: Interpret negative blkcount in file system problem reports
Non-expert users get confused when they see messages like this:

Illegal block #-1 (2291965952) in inode 176. CLEARED.

So change it to be something a little bit more understandable:

Illegal indirect block (2291965952) in inode 176.  CLEARED.

Addresses-SourceForge-Bug: #2871782

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-04 18:02:24 -04:00
Theodore Ts'o a321afa8b7 tests: Account for new mke2fs topology information
The previous commit adds a new line printed by mke2fs with the
filesystem/device topology information.  Update the regression test's
expected output to account for this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-04 16:21:13 -04:00
Valerie Aurora Henson 4efbac6fed Convert uses of super->s_*_blocks_count to ext2fs_*_blocks_count()
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07 20:46:34 -04:00
Valerie Aurora Henson a63745e81c Use ext2fs_file_acl_block() instead of using .i_file_acl directly
This provides support for 48-bit file acl blocks.

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07 22:29:45 -04:00
Valerie Aurora Henson 95fd65bb7f libext2fs: create generic numeric progress meters and use them
With 64-bit file systems, mke2fs can take a long time to do things
other than write inode tables.  I exported the mke2fs numeric progress
meter and used it for allocating group tables and the final file
system flush.

Signed-off-by: Valerie Aurora (Henson) <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-23 19:20:03 -04:00
Theodore Ts'o edc9e25634 f_illitable_flexbg: Add new test
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-19 01:16:47 -04:00
Theodore Ts'o f4240c8d56 libext2fs: Treat uninitialized parts of bitmaps as unallocated
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-09 23:22:32 -04:00
Theodore Ts'o c13351f6c5 Add support for configure --enable-verbose-makecmds
Some people don't want to see the concise "kernel-style" make output.
This configure option allows build engines that want to see the full
set of commands executed by the makefile to get what they want.  Most
people will find this more distracting than useful, unless they need
to debug the Makefiles.

(It is not necessary to rerun configure to enable this verbose make
output temprarily; if a developer wants to do a quick debug of a
directory's makefile, he or she can simply edit the definition of the
$(E) and $(Q) variables in the Makefile; instructions can be found in
the MCONFIG file which is included in at the beginning of every
Makefile.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-02 00:11:17 -04:00
Theodore Ts'o a6a1c0815c Fix Makefile dependencies for libcom_err
The e2fsprogs makefiles were using the same Makefile variable
LIBCOM_ERR for the link-line arguments as well as the dependencies.
Since LIBCOM_ERR can now include non-file arguments such as
"-lpthread", we need to use a separate DEPLIBCOM_ERR variable that
only has build file dependencies.

Do the same thing for STATIC_LIBCOM_ERR and PROFILED_LIBCOM_ERR.

Addresses-Sourceforge-Patches: #2813809

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-01 22:06:51 -04:00
Theodore Ts'o 8a48035095 Fix encoding for rec_len in directories for >= 64k blocksize file systems
Previously e2fsprogs interpreted 0 for a rec_len of 65536 (which could
occur if the directory block is completely empty in 64k blocksize
filesystems), while the kernel interpreted 65535 to mean 65536.  The
kernel will accept both to mean 65536, and encodes 65535 to be 65536.
This commit changes e2fsprogs to match.

We add the encoding agreed upon for 128k and 256k filesystems, but we
don't enable support for these larger block sizes, since they haven't
been fully tested.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-21 21:07:38 -04:00
Theodore Ts'o 58d29ed48a tests: Add --valgrind-leakcheck option to the test_script program
Add an option which runs valgrind with the appropriate options for
finding memory leaks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-15 01:33:26 -04:00
Theodore Ts'o 911ec62615 e2fsck: On a 32-bit filesystem, make sure i_file_acl_high is zero
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-23 21:31:16 -04:00
Theodore Ts'o 9af62fde65 tests: Filter out "Lifetime writes" from the dumpe2fs display
The Lifetime writes field will probably not be stable as we add new
features to e2fsprogs, so filter it out to avoid spurious test failures.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-08 19:01:03 -04:00
Theodore Ts'o 5299580c1c Use format strings directly to prevent -Werror=format-security failures
Gcc is too stupid to realize that:

    const char *usage="String which has no percent signs";

    com_err(progname, 0, usage);

is OK.  I refuse to bow to stupidity with:

   com_err(progname, 0, "%s", usage);

but I will use the string directly for the sake of people who like to
build with -Werror=format-security.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 13:05:25 -05:00
Theodore Ts'o dd04d05f70 e2fsck: Remove "ext3" from problem descriptions of the journal
The ext4 filesystem uses journals too, so remove "ext3" from the
problem descriptions involving journals.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-01 23:10:40 -05:00
Theodore Ts'o a558d5dc22 Add e2fsck regression test case f_extent_bad_node
This test case is designed to test e2fsck's ability to deal with a
corrupted interior node in an extent tree.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-12-25 22:47:03 -05:00
Theodore Ts'o 7dca4c88f1 e2fsck: When repacking directories, leave slack space for more efficiency
If the directory is packed with no slack space, as soon as any new
directory entries are added, leaf nodes end up getting split and
directory ends up getting very inefficient.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-12-25 17:59:36 -05:00
Theodore Ts'o d5a74ff10b e2fsck: Fix double-counting of non-contiguous extent-based inodes
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-12-22 01:23:59 -05:00
Theodore Ts'o 0eeec8ac61 Fix compiling under diet libc
Some recent changes had caused diet libc support to bitrot.  Fix up
missing header files and other portability fixups needed for dietlibc.
(Many of these changes also improve general portability.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-12 09:10:39 -04:00
Theodore Ts'o d1070d91b4 tune2fs, mke2fs: Change default directory hash algorithm to half_md4
The half_md4 algorithm is faster and more collision resistant.  Let's
switch to it as the default.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-29 20:02:50 -04:00
Theodore Ts'o efc6f628e1 Remove trailing whitespace for the entire source tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27 23:07:54 -04:00
Theodore Ts'o 674c0cc4cb ext2fs_mkjournal(): Don't allocate an extra block to the journal
Addresses-Sourceforge-Bug: 1483791

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27 17:03:37 -04:00
Theodore Ts'o 0f3c108363 Remove trailing space from the description of the r_move_itable test
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-24 21:58:03 -04:00
Andreas Dilger e5e12db959 fix e2fsck error message for bad htree depth
Fix error message to print the depth of a corrupt htree directory.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Kalpak Shah <kalpak.shah@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-08-24 21:57:31 -04:00
Theodore Ts'o 63b5e354d9 e2fsck: Fix check to see if an extent-based file is fragmented
Also added support for "e2fsck -E fragcheck" which issues a
comprehensive report of discontiguous file extents.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-10 22:43:24 -04:00
Theodore Ts'o 2a7bfe8353 Flush stdio buffers before calling setbuf()
On Solaris setbuf() will discard any pending output to the stream, so
make we call fflush() before calling setbuf().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:06:57 -04:00
Theodore Ts'o 318824c1bb Fix Solaris shell script portability issues
Solaris ships with a pathetically ancient shell in /bin/sh,
so fix various shell scripts to accomodate.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:06:56 -04:00
Theodore Ts'o 009c02baf9 Make ext2fs_check_desc() more stringent to force use of backup superbocks
E2fsck could to do more damage to a filesystem by trying to relocate
inode tables due to corrupted block group descriptors, and the
relocation could seriously damage the filesystem.

This patch enhances ext2fs_check_desk() so it detects more
self-inconsistent block group descriptors, including the cases where
e2sck might be tempted to relocate the inode table, and reports the
block group descriptors as invalid; this will cause e2fsck to attempt
to use the backup superblocks, which hopefully have not been trashed.

Addresses-Sourceforge-Bug: #1840291

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-10 17:25:33 -04:00
Theodore Ts'o 71ff129e9f Merge branch 'maint'
Conflicts:

	README
	resize/online.c
	version.h
2008-06-17 23:54:51 -04:00
Theodore Ts'o 9ff8ece57d mke2fs, tune2fs, resize2fs: Use floating point to calculate percentages
When calculating the number reserved blocks, use floating point for
better accuracy, since for big filesystems it really makes a
difference.  In addition, mke2fs and tune2fs accepts a floating point
number from the user, so they should provide that level of accuracy.

Addresses-Debian-Bug: #452639

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-17 21:08:49 -04:00
Theodore Ts'o 123b880846 Update tests to reflect undoe2fs -> e2undo rename
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 22:30:22 -04:00
Theodore Ts'o 81f6857b15 Fix LIBSS dependency problem for tests/test_icount and lib/ss/test_ss
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 22:19:52 -04:00
Theodore Ts'o dfb1d42a56 f_extents2: Add new test case testing e2fsck's support for extents
This test case tests blocks claimed by multiple inodes, as well as
other forms of invalid extents.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-02 20:36:52 -04:00
Theodore Ts'o 7609f54d7e Fix m_large_file and r_inline_xattr tests to match with recent changes
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-24 19:10:49 -04:00
Aneesh Kumar K.V 2ec408ef40 Add test cases for undoe2fs: u_undoe2fs_mke2fs and u_undoe2fs_tune2fs
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27 20:07:50 -04:00
Aneesh Kumar K.V 91803d8879 Fix the resize inode test case
With the new mke2fs changes the output of the
command differs if we run mke2fs on a device that
already have the file system. So erase the file system
before running mke2fs so that output remain as expected.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27 20:06:27 -04:00
Theodore Ts'o da292aa9af Merge branch 'maint'
Conflicts:

	tests/m_raid_opt/expect.1
2008-04-27 07:59:28 -04:00
Theodore Ts'o d94cc2eaa6 mke2fs: Don't allow the combination of the meta_bg and resize_inode features
The combination of meta_bg and resize_inode leads to a corrupt
filesystem, and it's not really clear it makes any logical sense.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27 00:08:14 -04:00
Theodore Ts'o 16b851cdae Remove LAZY_BG feature
This simplifies the code, and using the uninit_bg with the inode table
lazily initialized is just as good.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-20 23:33:34 -04:00
Theodore Ts'o 41a5afa87b libe2p: Print the s_min_extra_isize and s_wanted_extra_isize fields
Make dumpe2fs and debugfs print out the s_min_extra_isize and
s_wanted_extra_isize fields from the superblock.

Update tests expect files as appropriate.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-20 16:10:07 -04:00
Theodore Ts'o 2930dad2b2 Rename the feature uninit_groups to uninit_bg
Allow the old name of uninit_groups when converting feature names for
backwards compatibility for scripts running mke2fs and tune2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 23:31:44 -04:00
Theodore Ts'o 3d43836fda New mke2fs filesystem and usage types support
Provide mke2fs with a much more sophisticated system for controlling
configuration parameters of a newly created filesystem based on a
split filesystem and usage type system.  The -t option to mke2fs was a
deprecated alias to -c; it now specifies a filesystem type (ext2,
ext3, ext4, etc.), while the -T option can now be a comma separated
usage list.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-06 17:15:38 -04:00
Theodore Ts'o ae389208e9 Merge branch 'maint' into next 2008-04-06 17:10:49 -04:00
Theodore Ts'o 2efdba5866 Fix m_no_opt regression test
The m_no_opt test has been silently failing since the addition of
mke2fs.conf, since it was trying to use resize_inode on a non-sparse
filesystem.  Fix it so it works correctly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-06 17:07:04 -04:00
Theodore Ts'o b89fc30dd7 dumpe2fs: Print the group checksum and the block options in a nicer way
Also add support for printing the ITABLE_ZERO flag

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-01 14:59:47 -04:00
Andreas Dilger 0cf6e9c9f5 Add new regression test: f_uninit_last_uninit
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-31 14:32:39 -04:00
Andreas Dilger 0d47b68c2f Split the m_lazy test case into two cases: m_lazy and m_lazy_resize
Split the m_lazy testcase into two tests - one that has resize enabled,
and one that does not.  There were previously problems with lazy+resize
because the resize feature consumed blocks in some of the groups.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-31 14:28:38 -04:00
Andreas Dilger d78ea441a2 ext2fs_set_gdt_csum(): Force the last block group to have a valid block bitmap
Never set the UNINIT_BLOCKS flag for the last group since the kernel
doesn't handle the case graefully if there is a full set of blocks in
each blockgroup marked UNINIT_BLOCKS.  The kernel should be fixed up,
but in the meantime this avoids hitting the problem, and is more
consistent with lazy_bg not marking the last group UNINIT.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-31 14:28:37 -04:00
Theodore Ts'o 205372e24f Add new test case to check e2fsck's response to fast symlinks w/ EXTENTS_FL
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-24 08:24:45 -04:00
Jose R. Santos 635e20abc1 Add m_uninit test case
Add test case to test for uninit block groups.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20 15:33:13 -04:00
Jose R. Santos d2e29c950d Add new m_lazy test case
Add test case for lazy bg feature.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20 15:33:12 -04:00
Jose R. Santos 49a7360ba6 Make e2fsck uninit block group aware
This patch has all the necesary pieces to open and fix filesystems created
with the uninit block group feature.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20 15:33:12 -04:00
Theodore Ts'o abe85c9f1b Merge branch 'maint' into next 2008-03-20 15:31:03 -04:00
Theodore Ts'o 35efa44d49 Change valgrind options in test_script to conform with valgrind 3.2.3
Newer versions of valgrind seem to have renamed --wierd-hacks to
--sim-hints.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-15 11:16:56 -04:00
Theodore Ts'o a040a99b6c Merge branch 'maint'
Conflicts:

	lib/ext2fs/ext2_err.et.in
2008-03-13 10:53:26 -04:00
Theodore Ts'o 2a60480627 e2fsck: Use "Clear Htree" instead of "Clear" when the Htree is corrupt
Change the prompt so it is clear to the user that e2fsck will be
clearing the htree information, not the directory inode itself, when
the htree information has proven to be corrupt.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-13 10:44:54 -04:00
Theodore Ts'o 2cd1233839 e2fsck: Fix directory i_size handling
If a directory's i_size is bigger than the number of blocks, don't try
to allocate extra empty blocks to the end of the directory; there's no
real point to do that.  Also, if a directory's i_size is not a
multiple of the blocksize, flag that as a mistake so it can be fixed.

This more elegantly addresses the problem which was found on Bas van
Schaik's filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-13 00:58:54 -04:00
Theodore Ts'o 399033a6ab Merge branch 'maint' 2008-02-29 00:43:29 -05:00
Theodore Ts'o d0f24159aa Improve descriptions for the r_move_itable and r_resize_inode tests
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-28 19:54:03 -05:00
Eric Sandeen 09fbe0fb33 Add regression test for resize2fs moving inodes with inline xattrs
The image contains an inode past the resize point with an inline xattr
value of "propervalue".  It also contains deleted inodes which had the
xattr value "oldvalue".

When resize2fs moves the inode, it should copy the xattr as well, so
that post-resize we see "propervalue" not "oldvalue".

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-28 19:50:09 -05:00
Theodore Ts'o a49670e64e Merge branch 'maint'
Conflicts:

	lib/blkid/devname.c
	lib/blkid/probe.c
	misc/mke2fs.c
	misc/tune2fs.c
2008-02-27 18:53:34 -05:00
Theodore Ts'o 395529bb46 libe2p: Change Raid to RAID in display option
Update m_raid_opt test so that it reflects the code change.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-22 16:52:27 -05:00
Theodore Ts'o f159ff32e3 mke2fs: Remove warning for inode_size > 128 bytes
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-22 15:40:37 -05:00
Andreas Dilger 4b4850271e e2fsprogs-tests-f_ea_checks.patch
Test case for various types of extended attribute block corruption

Signed-off-by: Andreas Dilger <adilger@sun.com>
2008-02-18 21:45:33 -05:00
Andreas Dilger ab02809843 e2fsprogs-tests-f_unsorted_EAs.patch
Test case for allowing unsorted EAs in the fast in-inode space.

Signed-off-by: Andreas Dilger <adilger@sun.com>
2008-02-18 21:44:36 -05:00
Theodore Ts'o 0465bee402 Activate basic f_extents test case
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 20:11:07 -05:00
Theodore Ts'o 15d482ba6e e2fsck: Add support for extents
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 20:06:18 -05:00
Theodore Ts'o ef80fdc8ad Merge branch 'maint' into next 2008-02-10 08:03:54 -05:00
Theodore Ts'o 37f009ae22 Set the C locale in the tests/test_script driver
Since the test_script driver uses [A-Za-z], we need to set the locale
so we don't get bitten on locals where the sort order might be
different.

Addresses-Sourceforge-Bug: #1890526

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-10 07:58:08 -05:00
Theodore Ts'o 428f6b32a9 Merge branch 'maint' into next
Conflicts:

	configure
	lib/ext2fs/ext2_fs.h
	misc/e2image.c
2008-01-27 20:09:05 -05:00
Theodore Ts'o 0d1de232a8 Create filesystems with the ext_attr feature by default
Since recent kernels have a tendency to set this feature willy-nilly,
let's just enable by default.  It's only very old kernels that don't
support it any more.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-27 19:38:46 -05:00
Theodore Ts'o b1631cce64 Create new filesystems with 256-byte inodes by default
This makes it easier to upgrade to ext4 in the future, and it speeds
up extended attributes handling --- important on SELinux systems!

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-27 19:30:27 -05:00
Theodore Ts'o 2628a1d3e1 Merge branch 'maint' 2007-10-06 12:41:26 -04:00
Theodore Ts'o 29cf185826 Add test for the case where s_inode_size is zero
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>
2007-09-07 17:06:25 -04:00
Theodore Ts'o cc8fb0e69d Delete the test.img file after running the resize2fs tests
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>
2007-09-07 17:03:48 -04:00
Theodore Ts'o cd538080ab e2fsck: If the superblock is corrupt, automatically retry with the backup sb
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>
2007-09-07 16:54:11 -04:00
Theodore Ts'o dd44eb6b7f Remove e2fsck's swapfs test, since we've removed the functionality
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-11 01:59:13 -04:00
Theodore Ts'o 4764a579b4 Fix mke2fs tests to avoid needing any significant ^M (CR) characters
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-22 16:36:51 -04:00
Eric Sandeen bd828a27e2 Fix test in ext2fs_check_desc() for inode table within block group
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>
2007-07-22 16:00:43 -04:00
Theodore Ts'o 5a92a627f1 Properly calculate overhead in ext2fs_initialize()
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>
2007-07-22 15:14:38 -04:00
Kalpak Shah 575307cc63 e2fsck: Fix salvage_directory when the last entry's rec_len is too big
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>
2007-07-10 07:28:35 -04:00
Theodore Ts'o 424a3e4a23 Remove Changelog files since they're not used after the git migration
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 08:50:41 -04:00
Theodore Ts'o 6c9cc58375 Set LC_ALL instead of LANG in the test suite config
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>
2007-06-30 19:52:11 -04:00
Theodore Ts'o d7b64725ee Update Release Notes, Changelogs, version.h, etc. for 1.40 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-24 17:32:47 -04:00
Kalpak Shah 8cd1ab88dd New regression test which contains a corrupt ind. block in the journal inode
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2007-06-21 13:30:06 -04:00
Kalpak Shah 5107d0d196 Recreate journal that had been removed previously due to corruption
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>
2007-06-21 11:59:06 -04:00
Theodore Ts'o b8b143dbd0 Fix typo in name of f_dup4 regression test
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-04-14 14:01:57 -04:00
Jim Garlick 3d51ff876e e2fsck: pass1c terminates early if hard links
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>
2007-04-10 22:55:09 -04:00
Theodore Ts'o 62fc8cef45 Make the test_script ignore and skip empty test directories
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>
2007-04-07 23:16:11 -04:00
Theodore Ts'o 080fbf2bac Fix up usage and decrement error messages in the test_icount program
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-04-07 09:06:46 -04:00
Theodore Ts'o fbc3f90194 e2fsck: Recover a special file which looks an awful lot like a directory
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>
2007-04-02 10:08:59 -04:00
Theodore Ts'o 56c8c592ac Fix e2fsck to set the filetype of '..' when connecting a dir, to lost+found
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>
2007-03-31 19:18:24 -04:00
Theodore Ts'o 5e68f0eb84 Check in binary extent test image file into the source tree.
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>
2006-11-12 22:57:39 -05:00
Theodore Ts'o f77704e416 Add directory hashed signed/unsigned hint to superblock
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>
2006-11-11 22:32:35 -05:00
Theodore Ts'o 52325593b1 Add new a new tests make target "checked-failed" which reruns any failed tests
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-11-11 09:45:50 -05:00
Theodore Ts'o 5d17119d14 On-disk format definition for huge files
- 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>
2006-11-11 06:32:03 -05:00
Eric Sandeen abf23439d5 Create new ext2fs library inlines: ext2fs_group_{first,last}_block()
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>
2006-09-12 14:56:16 -04:00
Theodore Ts'o e54635de96 If diff -u is supported, use it to report test failures.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-08-06 14:33:13 -04:00
Matthias Andree 0ac93a00c9 Change more "echo -n" to "printf" to avoid screen clutter.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 15:47:05 +02:00
Theodore Ts'o 0cbd172def Make test scripts more robust against locale-related environment variables
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-05-28 23:41:23 -04:00
Theodore Ts'o 816ed71416 Update tests to reflect updated mke2fs.conf file
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-05-24 13:07:41 -04:00
Theodore Ts'o bc2699f018 Change mke2fs's layout of RAID-optimized filesystems to be more optimal
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>
2006-05-13 08:46:37 -04:00
Theodore Ts'o 9dc6ad1ecb Change mke2fs to use /etc/mke2fs.conf as a configuration file
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-23 22:00:01 -05:00
Theodore Ts'o 5dd2a6e08d Add E2FSCK_CONFIG environment variable
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>
2005-12-31 16:21:00 -05:00
Theodore Ts'o 8dceb92407 E2fsck: fix future times in the superblock's last mount or last write fields
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>
2005-09-24 21:59:45 -04:00
Theodore Ts'o cfe7ba4978 Add valgrind support to the regression test suite
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>
2005-08-08 19:29:15 -05:00
Theodore Ts'o 49809dd863 Make e2fsck Pass 1C header consistent with the other headers
Removed the period from the Pass 1C header to make it consistent with
the other e2fsck pass headers.
2005-07-04 13:08:37 -05:00
Theodore Ts'o 70f75dd76b Add missing changelog file for previous commit (hg changeset: 0502b63a5be9) 2005-07-04 13:04:05 -05:00
Theodore Ts'o f76344fb6f [BUGFIX]: E2fsck will segfault on disconnected inode with extended attribute(s)
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)
2005-07-04 12:53:36 -05:00
Theodore Ts'o 1f965c8d96 Update for e2fsprogs 1.38 release. 2005-06-30 20:06:45 -04:00
Theodore Ts'o 7ae1983a23 Clean up e2fsck problem description messages for typo's and to make them
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.
2005-06-19 09:45:36 -04:00
Theodore Ts'o d82f890355 defaults/e_script, run_e2fsck, d_loaddump, f_resize_inode,
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.)
2005-06-16 15:08:00 -04:00
Theodore Ts'o 7793279fc1 Fix the f_dup_resize script to be more portable and not rely on e2fsprogs
already being installed.
2005-05-08 01:01:02 -04:00
Theodore Ts'o 5e91614349 Don't offer to update or clone the resize inode when e2fsck deals with
multiply claimed blocks.
2005-04-14 17:10:14 -04:00
Theodore Ts'o 86a02b5d3d test_script.in: Make the test script driver exit with a non-zero
status if there are any failed tests.
2005-04-09 01:26:49 -04:00
Theodore Ts'o fd4b28efd3 Update for the e2fsprogs 1.37 release. 2005-03-21 22:37:03 -05:00
Theodore Ts'o d72e954f45 Fix the test image so that it actually has an ea-in-inode. 2005-03-21 17:15:18 -05:00
Theodore Ts'o ddbe33107e Add new test case which exercises the ea-in-inode checker in e2fsck. 2005-03-21 16:41:35 -05:00
Theodore Ts'o 3eee5e9eed Update for release of e2fsprogs 1.36. 2005-02-05 18:26:03 -05:00
Theodore Ts'o b7aa0d653e Remove *.pc files on a "make distclean"
Remove emacs backup files in tests/Makefile on a "make clean"
2005-02-05 15:48:49 -05:00
Theodore Ts'o 33db8f80f2 Remove support for --enable-clear-htree; this was
only needed during the early development of the htree patch.
2005-02-05 10:28:15 -05:00
Theodore Ts'o 1e87f8aea2 f_bad_inode, f_recnect_bad: Adjust test cases to take into
account the change which clears the i_file_acl field earlier.
2005-01-28 11:46:05 -05:00
Theodore Ts'o 6c313fd473 Fix e2fsck to not delete symlinks that contain an extended attribute after
the ext_attr feature flag has been cleared.  (Addresses Red Hat Bugzilla 
#146284)
2005-01-27 14:28:41 -05:00
Theodore Ts'o 06a6cbd2c8 Fix Solaris portability bug in the resize tests. 2005-01-26 13:34:57 -05:00
Theodore Ts'o 64ad98acbe resize2fs.c: Fix bug where we don't release the blocks belonging
to the old inode table blocks when we move the inode
	table.  (Addresses Debian Bug: #290894)
2005-01-26 10:03:56 -05:00
Theodore Ts'o 550a4afa24 E2fsck will now check the individual block group inode and block free counts,
as well as the filesystem-wide inode and block free counts.  If any of the
free counts is too large, force a full filesystem check.  (Addresses 
Debian Bug #291571)
2005-01-25 03:09:24 -05:00
Theodore Ts'o 02f61b8874 Skip the r_resize_inode test if resize2fs is not compiled (due to
configure's --disable-resizer option)
2005-01-21 19:52:03 -05:00
Theodore Ts'o 484ae818e4 r_resize_inode, m_dasd_bs, m_large_file, m_meta_bg, m_no_opt,
m_read_opt, m_std, run_mke2fs, filter_dumpe2fs: Make tests
portable so they pass correctly on a FreeBSD system.
2005-01-19 18:06:45 -05:00
Theodore Ts'o 32237014a1 Various portability fixes for Solaris systems. 2005-01-17 19:13:39 -05:00
Matthias Andree ae181fb473 f_dup_de, r_resize_inode: change ">& /dev/null" to ">/dev/null 2>&1"
for compatibility with FreeBSD. In $DEBUGFS commands, move the
-R arg argument first so that systems with non-GNU getopt()
can see the request argument (they would otherwise stop
parsing at the first non-option argument).
2005-01-13 04:23:24 +01:00
Theodore Ts'o de628f7c56 Fix f_resize_inode test to deal with the renaming of the debugfs command
set_inode to set_inode_field.
2005-01-07 22:46:21 -05:00
Theodore Ts'o f90c9919b4 Add two new tests, f_resize_inode, and r_resize_inode, to the regression
test suite, which tests e2fsck and reszizefs2, respecitvely.
2004-12-24 01:47:50 -05:00
Theodore Ts'o f581372280 m_meta_bg, m_no_opt, m_raid_opt: Adjust tests to take into
account the resize inode patch.
2004-12-15 17:53:23 -05:00
Theodore Ts'o 522798d342 Add install-strip and install-shlibs-strip targets
Use Linux-kernel-style makefile output for "make install"

Update intl/Makefile.in to version from gettext 0.14.1
2004-12-15 11:28:55 -05:00
Theodore Ts'o 47204ff983 Use Linux-kernel-style makefile output to make it easier to
see errors/warnings.
2004-11-30 10:52:27 -05:00
Richard Mortimer 6e4fbbeb50 Attempt recovery if the journal contains illegal blocks 2004-10-04 17:56:24 +01:00
Theodore Ts'o 56eb4d4749 Remove XSI:isms for greater portability. (Addresses
Debian Bug #255589)
2004-09-17 19:54:22 -04:00
Theodore Ts'o aa5c0a4562 Remove .cvsignore files; they were out of date, and causes lintian
to flame about their presence in the source tarball.
2004-05-05 09:02:36 -04:00
Theodore Ts'o b70b1167fe Update version number for e2fsprogs 1.35 release. 2004-02-28 10:52:35 -05:00
Theodore Ts'o ac0de52b4b Add f_selinux test case. 2004-01-30 01:59:42 -05:00
Matthias Andree b969b1b8a5 Fix more compiler warnings. 2003-12-28 13:04:35 +01:00