Commit Graph

66 Commits (478360f50b68356849813f97db46fd156da5248e)

Author SHA1 Message Date
Theodore Ts'o fef2b38d8e Merge branch 'maint' into next
Conflicts:

	configure
	debian/rules
	e2fsck/swapfs.c
	lib/ext2fs/ext2_fs.h
2008-01-01 12:41:35 -05:00
Theodore Ts'o d66c38329e e2fsck: When optimizing non-htree directories, sort by inode number
Previously "e2fsck -fD" on a non-htree directory would sort the
directory alphabetically by name.  That's stupid.  Better to sort the
directory by inode number, since that will optimize performance much
more significantly than sorting by name!

Addresses-Sourceforge-Feature-Request: #532439

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-01 10:59:57 -05:00
Theodore Ts'o 6d96b00d57 Add I/O statistics to e2fsck
This patch instruments the libext2fs unix I/O manager and adds bytes
read/written and data rate to e2fsck -tt pass/overall timing output.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-03 20:07:09 -04:00
Theodore Ts'o 28db82a84a Rework e2fsck's dirinfo abstraction to be more friendly for databases
Change the iterator abstraction and replace e2fsck_get_dir_info() with
e2fsck_dir_info_{set,get}_{parent,dotdot} so that we can support an
on-disk dirinfo implementation.  This allows e2fsck to check very large
filesystems on systems with smaller amounts of memory and/or address
space.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-04-04 22:33:31 -04: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 544349270e Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
Theodore Ts'o 520ead378e Fix gcc -Wall warnings. 2003-04-19 13:48:27 -04:00
Theodore Ts'o 12dd69f5ff e2fsck/rehash.c (name_cmp): Sort the deleted inodes to the end
of the list, for portability to systems that whose qsort
	does not perform a stable sort.
2003-04-17 21:55:38 -04:00
Theodore Ts'o 1d2eef4227 rehash.c (e2fsck_rehash_dir): If user specified the -n option,
skip trying to write out directory.
	(e2fsck_rehash_directories): Fix the percentage
	calculation in the progress bar.
2003-03-15 13:30:07 -05:00
Theodore Ts'o 52734dc532 Don't display progress bar when rebuilding directories unless
explicitly requested by the user.
2003-03-15 04:03:43 -05:00
Theodore Ts'o b0700a1b60 Change e2fsck to detect and offer to delete or rename duplicate
filenames in directories when rebuilding directories using
"e2fsck -fD /dev/XXX"
2003-03-14 01:43:56 -05:00
Theodore Ts'o fe5b72d15e rehash.c (e2fsck_rehash_dir): Apply patch from Christopher Li
which avoids creating an empty directory entry at the end
	of the directory block.  This screws up earlier versions
	of the indexed directory patch.
2002-09-29 19:05:26 -04:00
Theodore Ts'o e70ae99e07 Add a more sophisticated algorithm to e2fsck to salvage corrupted
directories.

Speed up e2fsck slightly by only updating the master superblock;
there is no point to update the backup superblocks.

Fix a small bug in the rehashing code which could leave the indexed
flag set even after the directory was compressed instead of indexed.
(Not fatal, since the kernel will deal with this, but technically
it filesystem isn't consistent, and the filesystem will be marked
as being in error when the kernel comes across the directory.  It
should also never happen in real life, since directories that small
will never be indexed, but better safe than sorry.)

Also change the threshold of when directories are indexed, so that
directories of size 2 blocks will be indexed.  Otherwise they will
never be indexed by the kernel when they grow.
2002-09-28 09:16:28 -04:00
Theodore Ts'o cf3909edfe rehash.c (copy_dir_entries): Fix bug which caused corrupted
directories if there are 4 or 8 bytes left over in a
	directory page when optimizing/reindexing a directory.
2002-09-06 10:14:12 -04:00
Theodore Ts'o 850d05e9aa Add e2fsck -D option which optimizes/compresses directories.
General cleanup of rehash code.  (Fixed a few bugs, reformatted
code to make it more maintainable, etc.)
2002-07-25 00:00:08 -04:00
Theodore Ts'o b7a00563b2 Add support to e2fsck to reindex directories to use hash trees. 2002-07-20 00:28:07 -04:00