Theodore Ts'o [Fri, 1 Nov 2002 00:56:56 +0000 (19:56 -0500)]
resize2fs.c (inode_scan_and_fix, check_and_change_inodes): When
moving an inode, set the ctime field so that people using
dump/restore will backup the changed inode. Also update
the mtime and ctime of directories which get updated when
we need to move an inode.
Theodore Ts'o [Fri, 1 Nov 2002 00:39:03 +0000 (19:39 -0500)]
unix.c (usage), e2fsck.8.in: Add the -D option to the usage and
command synopsis. (Addresses Debian bug #167108)
(missed this file in the previous checkin)
Theodore Ts'o [Thu, 31 Oct 2002 23:38:55 +0000 (18:38 -0500)]
pass1.c (e2fsck_pass1): Check the superblock write time to see
whether or not we can safely do the LOW_DTIME checks.
(Addresses Sourceforge bug #620980)
Theodore Ts'o [Thu, 31 Oct 2002 20:17:16 +0000 (15:17 -0500)]
gen_uuid.c (get_random_bytes): Don't spin forever if read()
returns EINTR or EAGAIN, so that when /dev/random is
opened O_NONBLOCK, we don't end up spinning forever.
Theodore Ts'o [Thu, 31 Oct 2002 18:23:37 +0000 (13:23 -0500)]
ismounted.c (check_mntent, check_mntent_file): Add better
support for loopback-mounted filesystems. Check /etc/mtab
if /proc/mounts doesn't turn up any mount flags, since
/etc/mtab has the loopback image filename, instead of
/dev/loop0. Also, check based on st_dev and st_ino, so
that if a relative pathname or a pathnames using symbolic
links are used, we can detect the the filesystem correctly
in those cases. (Addresses Sourceforge bug #619119)
Theodore Ts'o [Thu, 31 Oct 2002 17:21:05 +0000 (12:21 -0500)]
flushb.c (ext2fs_sync_device): If the BLKFLSBUF ioctl succeeds,
don't try the FDFLUSH ioctl that was required for floppies
with older kernels. This avoids needless whining from the
MD device driver. (Addresses Sourceforge bug #545832).
Theodore Ts'o [Thu, 31 Oct 2002 16:45:06 +0000 (11:45 -0500)]
openfs.c (ext2fs_open): Fix bug which caused us to pass the
wrong group_block to ext2fs_descriptor_block_loc if we're
using the backup superblock/block group descriptors.
(ext2fs_descriptor_block_loc): If we're using the backup
superblock descriptors, use the backup descriptor block in
the next block group.
Theodore Ts'o [Mon, 28 Oct 2002 21:52:12 +0000 (16:52 -0500)]
fsck.c (main): Fix bug reported by Gregory Mutt. Multiple
filesystems explicitly specified on the command line were
not being checked in parallel, due to a logic bug
introduced in to support the FSCK_MAX_INST environment
variable.
Theodore Ts'o [Fri, 25 Oct 2002 21:29:55 +0000 (17:29 -0400)]
Add a new superblock field, s_mkfs_time, which indicates when
the filesystem was created. It is set via mke2fs, and printed
via list_super2() (which is called by dumpe2fs).
Also, list_super2() will now print "n/a" if the last mount time
(s_mtime) is zero.
Theodore Ts'o [Fri, 25 Oct 2002 21:07:11 +0000 (17:07 -0400)]
dumpe2fs.c (list_desc, main): Make dumpe2fs more robust so that
if there is an error reading the block/inode bitmaps, it
will still print out the contents of the block group
descriptors.
Theodore Ts'o [Thu, 3 Oct 2002 05:09:35 +0000 (01:09 -0400)]
Handle BAD_BLOCK_IN_INODE_TABLE even at the beginning of the
inode table, and shrink code by reorganizing the while loop so
to eliminate duplicate calls to ext2fs_get_next_inode().
Theodore Ts'o [Thu, 3 Oct 2002 02:07:17 +0000 (22:07 -0400)]
Fix endian problems in the htree code for e2fsck and debugfs.
When byte-swapping a filesystem on a PPC architecture, byte-swap
the bitmaps since the historical big-endian ext2 variant had
byte-swapped bitmaps, and the ext2fs library assumes this. Otherwise
the regression test suite will fail...
Avoid counting directory entries during a directory salvage.
Add additional checks to HTREE directories. We now check the count
and limit fields in the htree header, as well as assuring that the
hash table in each interior node is in ascending order. We also
check to make sure all leaf nodes are have the expected depth in
the tree.
badblocks.c (main): Appled sourceforge patch #600451, which
addresses sourceforge bug #600388, by AEF. This allows
badblocks to work correctly on read-only devices such as
CD-ROM's, DVD's, etc.
pass2.c (check_dir_block): Do a more paranoid check when trying
to determine whether or not a directory entry is a
completely empty leaf block or leaf node. Otherwise
e2fsck might get confused into thinking that a valid dxdir
was corrupted.
mke2fs.8.in, tune2fs.8.in: Clarify manual pages about using the
caret ('^') character to negate feature sets when using
the -O option. Define the has_journal feature to avoid
confusion about what ^has_journal means.
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.
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.
fsck.c: If the bone-headed user enters the filename twice, the
-R option which skips the root filesystem will skip all of
them. (Addresses Debian bug #159423). Note! This is not
a precedent for dealing intelligently with any other kind
of doubled entry in /etc/fstab!
mke2fs.c (main): Enable directory indexing by default.
tune2fs.c (update_feature_set): Allow directory indexing flag to
be set. If so, set the default hash to be TEA, and
initialize the hash seed to a random value.
get_device_by_label.c (init_lvm): Fix bug which caused
LABEL='xxx' to not work correctly when using LVM.
(Reversed sense of error check reported by ateeq@hotpop.com)
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.
Theodore Ts'o [Sat, 31 Aug 2002 06:35:35 +0000 (02:35 -0400)]
ehandler.c (e2fsck_handle_read_error): If the user asks to
ignore the error, offer to try forcing a write of the
block to the disk; sometimes this will cause the drive to
remap the bad block.
Theodore Ts'o [Sat, 31 Aug 2002 06:32:41 +0000 (02:32 -0400)]
Fix a bug which caused e2fsck to fail to correctly check filesystems
using a non-zero hash version (i.e., half MD4 or TEA hash).
The hash version wasn't getting copied into dx_dir->hashversion and
this caused the kernel to treat all directories if they were using the
legacy hash, which was Bad.
Theodore Ts'o [Sat, 24 Aug 2002 04:04:03 +0000 (00:04 -0400)]
Add support for the hash_seed and s_def_hash_ver fields in the
superblock. Dumpe2fs can now print out these fields, and they
can be modified using debugfs's set_super_value command. Also added
to debugfs was the ability to set s_uuid and s_journal_uuid features
as well.
Theodore Ts'o [Tue, 20 Aug 2002 05:14:30 +0000 (01:14 -0400)]
valid_blk.c (ext2fs_inode_has_valid_blocks): Fix bug which
failed to accurately characterize non-standard slow
symlinks. (Which don't appear in practice on real-life
systems, fortunately.)
Theodore Ts'o [Sun, 18 Aug 2002 07:37:10 +0000 (03:37 -0400)]
Makefile.in: Revamp makefile so that it doesn't depend
--enable-elf-shlibs. We always build the shared library,
since it's meant to be used as a plugin library.
Theodore Ts'o [Sun, 18 Aug 2002 05:48:46 +0000 (01:48 -0400)]
fs_ext2.c, fsimext2.c: Synchronize with EVMS CVS tree.
Fixed up confusion caused by bad parameter names for
get_fs_limits(). Added missing conversion of
volume->vol_size from sectors to bytes. Fix up error
returns for unsupported tasks as EINVAL, not ENOSYS.
Use logical names for the API version numbers, since
the ABI is much more dependent on the headers. Add
code to byte-swap the superblock if necessary.
Theodore Ts'o [Sun, 18 Aug 2002 01:11:29 +0000 (21:11 -0400)]
Update to debian's 1.27+1.28-WIP-0626-1
Revert the shlibs hack.
Makefile.in: Remove inode_io.o from the standard object files
in libext2fs, and only build it if debugfs is enabled
(it requires fileio.o, which is only built if
--disable-debugfs isn't specified to configure).
Theodore Ts'o [Sat, 17 Aug 2002 18:44:56 +0000 (14:44 -0400)]
chattr.1.in: Document the compression attribute flags E, X, and
Z, and explain that chattr can't set or set these flags.
(Addresses Debian Bug #151990)
fsetflags.c (fsetflags), fgetflags.c (fgetflags.c), setflags.c
(setflags), getflags.c (getflags): Check to make sure the
file is a regular file or a directory before attempting to
use the ext2 ioctls. Otherwise, return EOPNOTSUPP.
(Addresses Debian Bug #152029).
Theodore Ts'o [Sat, 17 Aug 2002 14:52:51 +0000 (10:52 -0400)]
Modify the half MD4 hash so it is no longer endian dependent. This is
a backwards incompatible change, but this should be OK since the kernel
MD4 ext3 code was only in the CVS tree, and hasn't generally escaped.
Theodore Ts'o [Tue, 13 Aug 2002 19:16:47 +0000 (15:16 -0400)]
Makefile.in: Move dupfs.o and test_io.o from the
needed-by-debugfs object list to the needed-by-resizer
object list. Fixes compile problem if the system is built
with only --disable-debugfs.
Theodore Ts'o [Thu, 1 Aug 2002 16:37:00 +0000 (12:37 -0400)]
Change e2fsck to use a red/black tree in pass1b, to remove O(n**2)
algorithms. Makes e2fsck much, much faster in certain rare cases
where the filesystem is severely corrupted.
resize2fs.c (block_mover): If there are no blocks to move,
release the bmap table. This significantly speeds up
resize2fs when shrinking or expanding a filesystem by a
very small number of blocks (which EVMS will do).
dirhash.c (ext2fs_dirhash): Fix bug which caused MD4
calculations for names > 32 characters to be completely
bogus. Changed MD4 calculation to match what is currently
being used in the CVS gkernel tree.
pass1.c (e2fsck_pass1): If e2fsck is run with -n, don't create
the dirs_to_hash list, since we don't want to reindex
directories if the filesystem is opened read-only.
Add SIGINT and SIGTERM handling to fsck and e2fsck. For e2fsck,
make sure we gracefully clean up and only exit at safe points.
For fsck, we pass the SIGINT/SIGTERM signal to the child processes,
so they can do their own cleanup.
Various portability fixes which should help out HURD.
The iterate_on_dir function in libe2p has been changed to be more
general, so it relies less on the layout of struct dirent. We also
make sure the errno returned by the ioctl is returned by
fgetversion() and fsetversion().
unix_io.c (unix_open): Only attempt the setrlimit workaround if
the kernel version is 2.4.10 -- 2.4.17, since otherwise an
old version of glibc (built against 2.2 headers) will
interact badly with the workaround to actually cause more
problems. I hate it when the glibc folks think they're
being smarter than the kernel....
mke2fs.c (zap_sector): Clear the buffer *after* testing for the
BSD sector label. Otherwise the first 512 bytes don't get
zapped. (Addresses Debian bug #147256.)