Commit Graph

290 Commits (a3efe4842054175d01b465fbe0b29b9be8b800a1)

Author SHA1 Message Date
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