Commit Graph

2934 Commits (7dca4c88f166561031011ed27287818eaa343486)

Author SHA1 Message Date
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 100d4701d5 e2fsck: Enhance fragcheck report with file/directory information
Report whether a fragmented inode is a directory or a file, as this is
highly useful for determining what is going on with an ext4 filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-12-08 22:00:13 -05:00
Theodore Ts'o ce44d8cafa e2fsck: In verbose mode, distinguish between fragmented directories/files
Track the number of non-contiguous files and directories so we can
give more detailed information in verbose mode.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-12-08 21:33:11 -05:00
Theodore Ts'o 42e89ce7f8 e2fsck: Don't cancel the fsck run after clearing an errant INODE_UNINIT flag
Thanks to Kelly Kane from Dreamhost for reporting this bug and then
helping us find and fix it.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-26 20:41:26 -05:00
Theodore Ts'o 8680b4e680 Add make-sparse.c to contrib
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-17 17:52:15 -05:00
Theodore Ts'o 124e6767fc debian: Fix mkinitfs on x86_64 systems
On x86_64 systems, we need to filter out linux-vdso.so lines from the
output of the ldd program when determining the library dependencies.

Addresses-Debian-Bug: #503057

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-16 10:35:41 -05:00
Theodore Ts'o 03fa6f8ae2 Fix various signed/unsigned gcc warnings
Some of these could affect filesystems between 2^31 and 2^32-1 blocks.

Thanks to Valerie Aurora Henson for pointing out the problems in
lib/ext2fs/alloc_tables.c, which led me to do a "make gcc-wall" scan
over the source tree.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-16 10:06:59 -05:00
David Planella dd20e25f06 po: update ca.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-11-15 15:07:39 -05:00
Theodore Ts'o a11d0746b4 dumpe2fs: Only print inline journal information if the journal is internal
Currently dumpe2fs displays an error if run on a filesystem with an
external journal.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-15 15:05:51 -05:00
Theodore Ts'o ad64399d15 Add support to build profiled binaries in the misc directory
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-15 12:34:28 -05:00
Theodore Ts'o 992a2f7f68 e2fsck: Fix build of e2fsck.profiled if profiling is enabled
It's been a while since I've done a build using "configure
--enable-profile", and some bitrot had set into the Makefiles...

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-15 12:12:57 -05:00
Theodore Ts'o 27c6de45a4 tune2fs: Fix inefficient O(n**2) algorithms when expanding the inode size
When running "tune2fs -I 256" on moderate to large filesystems, the
time required to run tune2fs can take many hours (20+ before some
users gave up in disgust).  This was due to some O(n**2) and O(n*m)
algorithms in move_block() and inode_scan_and_fix(), respectively.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-15 00:32:39 -05:00
Theodore Ts'o 9d4a4dc287 tune2fs: Update the block group checksums when changing the UUID
Since the block group checksums depend on the UUID, we need to update
the block group checksums when setting the UUID.  We only do so if all
of the checksums are correct, however.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-14 17:42:27 -05:00
Theodore Ts'o e3d41d397f debugfs: Fix ncheck display so that extra characters aren't printed
Fix a single-character typo in the printf format statement.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-20 23:51:53 -04:00
Eric Sandeen 9e7da0bdc1 blkid: recognize ext3 with test_fs set as ext3
It seems that if we have the test_filesystem flag set on an ext3
filesystem(!) on a system which provides ext4, blkid gets confused.

According to the current logic:

* It's not an ext4dev filesystem, because the system provides ext4.
* It's not an ext4 filesystem, because it has no ext4 features.
* It's not an ext3 filesystem, because the test flag is set.

In the end, it's nothing.

blkid should return *something* that is mountable... I'm inclined to
think that ext3 should be the right answer, if no ext4-specific features
are set.

This would mean just dropping the EXT2_FLAGS_TEST_FILESYS test in
probe_ext3(), because ext4 & ext4dev probes have come first already.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-10-18 17:19:56 -04:00
Theodore Ts'o cb293cfc8b Fix spelling mistake in debian changelog
Addresses-Debian-Bug: #502323

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-18 16:52:25 -04:00
Theodore Ts'o fe144e11e9 libblkid: Refuse to create a device structure for a non-existent device
Fix blkid_get_dev() so it will never return a device structure if the
device file doesn't exist.

Addresses-Debian-Bug: #502541

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-18 16:47:46 -04:00
Theodore Ts'o df547ae886 Update release notes, changelog, etc., for e2fsprogs 1.41.3 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-12 23:27:32 -04:00
Theodore Ts'o 052a791185 Update e2fsprogs translation template file
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-12 23:18:20 -04:00
Theodore Ts'o 80875db58a e2fsck: Offer to clear the test_fs flag if ext4 is available
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-12 23:12:23 -04:00
Theodore Ts'o 4758835c28 e2fsck: Print the correct inode number for uninit-bg related problem reports
Fix the reporting for problem codes PR_2_INOREF_BG_INO_UNINIT and
PR_2_INOREF_IN_UNUSED.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-12 23:12:22 -04:00
Theodore Ts'o 6964a17720 libblkid: Fix file descriptor leak when checking for a module
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-12 23:12:22 -04:00
Eric Sandeen 79cc336282 e2fsck: exit from preenhalt if IO errors were encountered
If a block device is read-only, e2fsck -p gets into an infinite loop
trying to preenhalt, closing and flushing the fs, which tries to flush
the cache, which gets a write error and calls preenhalt which tries to
close and flush the fs ... ad infinitum.

Per Ted's suggestion just flag the ctx as "exiting" and short-circuit
the infinite loop.

Tested by running e2fsck -p on a block device set read-only by BLKROSET.

Thanks to Vlado Potisk for reporting this.

Addresses-Red-Hat-Bugzilla: #465679

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-10-12 23:12:22 -04:00
Eric Sandeen 279a000fdc resize2fs: check for bogus new_size
If we don't check for new_size == 0, bogus values send resize2fs into
a tailspin:

resize2fs 1.41.0 (10-Jul-2008)
Illegal block number passed to ext2fs_test_block_bitmap #1 for block bitmap for
/tmp/tmp.lntZtMFvz8/fake-disk
...the same message repeated zillion times...

Probably should see where that loop is, but at any rate we should
error-check parse_num_blocks.

Thanks to Petr Muller for reporting this.

Addresses-Red-Hat-Bugzilla: #465984

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-10-12 23:12:22 -04:00
Eric Sandeen 7ed7a4b6ed unix_io: check for read-only devices when opening R/W
When we open a device on linux, test whether it is writable
right away, rather than trying to proceed and clean up when
writes start failing.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-10-12 23:12:22 -04:00
Theodore Ts'o a25f0e73a7 debugfs: Fix ncheck when printing pathnames for multiple hardlinks in a directory
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-12 23:12:22 -04:00
Theodore Ts'o f0eae15c36 Fix parallel build problem with util/subst
Make sure util/subst is built before trying to build lib/et

Addresses-Sourceforge-Bug: #2143281

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-12 23:12:22 -04:00
Eric Sandeen 18f7343010 e2fsprogs: fix blkid detection of ext4dev as ext4
If only ext4 is available (as a module or in /proc/filesystems)
blkid wasn't properly testing for it, because the time checks
were backwards and always failed.  This caused old ext4dev
filesystems to fail to mount as ext4.  With this patch it works
fine.

Also, don't try to check for modules on a non-Linux system.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-10-12 23:11:44 -04:00
Theodore Ts'o d58d8320e8 Update Makefile depend information for crc16.o
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-02 08:59:09 -04:00
Theodore Ts'o c12125f79a Update release notes, changelog, etc., for e2fsprogs 1.41.2 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-02 08:54:41 -04:00
Theodore Ts'o 98e9fb9d53 libcom_err: Add missing type declarations to clean up -Wall warnings
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-02 08:52:38 -04:00
Theodore Ts'o 08c8b1ab34 mke2fs.8: Add an explanation of how the -t and -O options interact
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-02 08:47:48 -04:00
Gran Uddeborg 3a2e089587 po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-10-01 21:52:02 -04:00
Theodore Ts'o 902be4ab7d libcom_err: Fix file descriptor leak after an exec
Some applications repeatedly re-exec themselves, and if they use the
com_err library, they can leak a file descriptor for each re-exec.
Fix this by setting the close-on-exec flag on the debug file
descriptor.  In addition, if the COMERR_DEBUG environment variable
isn't set, don't open the file handle at all.

Addresses-Red-Hat-Bugzilla: #464689

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-01 21:13:46 -04:00
Theodore Ts'o 0f589a4d57 Fix spelling mistake in e2fsck man page
Addresses-Launchpad-Bug: #275272

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-01 20:27:41 -04:00
Theodore Ts'o 42e572b5b6 badblocks: Fix progress output for "badblocks -sw /dev/XXX"
Always initialize the starting time so that badblocks -sw works.
Thanks Jelle de Jong (jelledejong at powercraft.nl) for reporting this
bug.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-01 20:00:54 -04:00
Manish Katiyar c59776306c debugfs: Make the usage messsage of logdump consistent with man page
Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-01 19:55:10 -04:00
Manish Katiyar 520a177292 resize2fs: Fix potential memory corruption in ext2fs_progress_init()
Check the return value of ext2fs_get_mem, since prog isn't initialized
so checking may miss a failed memory allocation.

Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-01 19:42:57 -04:00
Theodore Ts'o 03206bd825 debugfs: Fix ncheck to print all pathnames for the inodes
The ncheck command in debugfs had a bug where some inodes would not
have their pathnames printed if other inodes had more than one hard
link.  Fix this bug and simplify the code by printing all of the
pathnames for the requested inodes.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-01 19:14:06 -04:00
Theodore Ts'o d7f45af802 libcom_err: Use sem_post/sem_init to prevent race conditions
SuSE has been carrying a patch for a long time to prevent a largely
theoretical race condition if a multi-threaded application adds and
removes error tables in multiple threads.  Unfortunately SuSE's
approach breaks compatibility by forcing applications to link and
compile with the -pthread option; using pthread mutexes has
historically been problematic.

This commit fixes things in a more portable way by using
sem_post/sem_wait instead, which is an older interface that doesn't
require the pthreads library.  Linux happens to implement
sem_post/sem_init using futexes, and -lrt ends up pulling in
-lpthread, but the advantage of using POSIX semaphores is that
applications don't have to be built using -pthread, unlike the use of
pthread mutexes.

The add_error_table() and remove_error_table() interfaces are the
preferred interfaces and locking protection have been added to only
these interfaces.  I have not added locking protection to the
generated initialize_xxx_error_table and initialize_xxx_error_table_r
interfaces, to avoid adding symbol dependencies that would cause a
library to fail to work when linking against older com_err libraries
that do not export et_list_lock() and et_list_unlock().  Threaded
applications shouldn't be using these interfaces in any case.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-12 10:15:26 -04:00
Theodore Ts'o 3218dc9db8 debian: Use dietlibc when possible for building e2fsck.static
This fixes a regression introduced in commit 4f2e8f19 where we
inadvertently disabled the use of dietlibc on all architectures,
instead of just on those architectures which didn't support dietlibc.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-12 09:26:45 -04: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 f8bd55160c debugfs: Add the ability to specify the hash seed to the "hash" command
Also add the ability to specify the hash algorithm by name instead of
by number.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-10 11:30:46 -04:00
Theodore Ts'o 52771ab591 e2fsck: Fix e2fsck automatic blocksize detetion
This fixes a regression that was introduced in commit dcc91e10 (it
showed up first in e2fsprogs 1.40.7).  Since we weren't freeing the
filesystem handle, ext2fs_open2() was returning EBUSY, and so this
caused a failure in the code that would automatically determine the
filesystem block size when only the superblock number was specified by
the user.

This was discussed in http://ubuntuforums.org/showthread.php?t=789323,
and Matthias Bannach pointed this out to me, for which I am very
grateful.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-09 15:02:24 -04:00
Clytie Siddall 5bf3f80da0 po: update vi.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-09-07 22:55:25 -04:00
Benno Schulenberg 6d8fb8e52a po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-09-07 22:55:25 -04:00
Arif E. Nugroho d83e33a54b po: update id.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-09-07 22:55:25 -04:00
Philipp Thomas 4077127d4b po: update de.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-09-07 22:55:25 -04:00
Petr Pisar 1dba88d017 po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-09-07 22:55:24 -04:00