Theodore Ts'o [Mon, 27 Jan 2003 06:09:24 +0000 (01:09 -0500)]
Roto-till and clean up libblkid API.
read.c (parse_tag): Do not return that blkid_tag when parsing
the blkid.tag file.
resolve.c (blkid_get_token, blkid_get_tagname_devname): Fold in
code from removed functions
tag.c (blkid_create_tag): Don't return the newly tag strcture
any more, as it's not needed.
(blkid_find_tag_cache, blkid_get_tag_cache,
blkid_token_to_tag, blkid_find_tv_tags): Remove these
functions, as they are either only used once or have
interfaces that should be deprecated.
(blkid_find_tag_dev, blkid_find_head_cache): Replace use
of blkid_tag with one or two const char * type/value
arguments.
(blkid_find_dev_with_tag): Fold in code from removed functions
probe.h, probe.c: Use a more sophisticated set of byte-swapping
routines which are more compact and efficient. Drop
calculation of bid_free, since it's unnecessary. Avoid
save.c (blkid_save_cache): Set the permissions on the blkid
cache file to 644.
Theodore Ts'o [Sun, 26 Jan 2003 06:54:39 +0000 (01:54 -0500)]
Separate public and private interfaces into separate header files.
Start separating internal implementation details from the
publically exported interface of the blkid library.
Theodore Ts'o [Mon, 20 Jan 2003 02:01:22 +0000 (21:01 -0500)]
initialize.c (ext2fs_initialize): If the user specifies a really
large number of inodes, then reduce the number of blocks
per group until we find a workable set of filesystem
parameters.
ext2_err.et.in (EXT2_ET_TOO_MANY_INODES): Add new error code.
Theodore Ts'o [Wed, 13 Nov 2002 12:00:16 +0000 (07:00 -0500)]
Update to deal with the fact that the INDEX_FL code in the ext2 2.4
code accidentally had the INDEX_FL backwards compatibility code
removed. E2fsck will now fix HTREE corruptions in preen mode, and
mke2fs will not create filesystems with the dir_index flag set
by default. (The user has to specifically request it.)
Theodore Ts'o [Sat, 9 Nov 2002 19:56:17 +0000 (14:56 -0500)]
unix_io.c (find_cached_block, reuse_cache, unix_read_blk,
unix_write_blk): Optimize routines so that we don't end up
searching the cache twice when a block isn't in the
cache. If reads are larger than READ_DIRECT_SIZE, don't
let them go through the cache.
Theodore Ts'o [Sat, 9 Nov 2002 15:33:49 +0000 (10:33 -0500)]
unix_io.c (find_cached_block): Fixed bug which caused some clean
blocks to be erroneously marked as dirty, so they would
get written back to the disk before they are evicted from
the cache. Harmless, but it slows down e2fsck
significantly.
Theodore Ts'o [Fri, 8 Nov 2002 20:55:17 +0000 (15:55 -0500)]
unix.c (main): Fix a bug where e2fsck could erroneously mark a
filesystem as being valid if it was being checked and it
is interrupted with a ^C. (Bug introduced in e2fsprogs
1.28.)
Theodore Ts'o [Fri, 8 Nov 2002 20:35:13 +0000 (15:35 -0500)]
unix.c (PRS), journal.c: Set the default level of journal
debugging to be 0, and allow the user to set the level of
journal debugging by using the E2FSCK_JBD_DEBUG
environment variable.
Theodore Ts'o [Fri, 8 Nov 2002 19:55:38 +0000 (14:55 -0500)]
Skip byteswap tests on --disable-swapfs
Disable certain tests that depend on the byteswapping functions
being present so that "make check" succeeds even if --disable-swapfs
is passed to the configure script.
Theodore Ts'o [Fri, 8 Nov 2002 19:10:15 +0000 (14:10 -0500)]
fs_ext2.c (fs_expand, fs_shrink),
fsimext2.c (fsim_mkfs, fsim_fsck): Inform the user if e2fsck,
mke2fs or resize2fs dies with a signal, or if the exit
with a non-zero exit status.
Theodore Ts'o [Fri, 8 Nov 2002 17:26:37 +0000 (12:26 -0500)]
fsimext2.c (set_mkfs_options): Synchronize with EVMS CVS rev
1.7 (2002/09/11): Add a hack to force mkfs won't a
blocksize equal to the hardsector size if it is larger
than 512 bytes.
Theodore Ts'o [Fri, 8 Nov 2002 16:54:29 +0000 (11:54 -0500)]
fs_ext2.c (fs_expand, fs_shrink): Synchronize with EVMS CVS rev
1.11 (2002/8/27). Read from the resize2fs output in
non-blocking mode, so the GUI continues to updates the window.
Theodore Ts'o [Fri, 8 Nov 2002 16:10:28 +0000 (11:10 -0500)]
Change e2fsck to force out changes to the backup copies of the
superblock and block group descriptors when important changes
are made to those data structures.
Theodore Ts'o [Fri, 8 Nov 2002 14:21:46 +0000 (09:21 -0500)]
closefs.c (write_bgdesc, ext2fs_flush): Fix bug in meta_bg
support when the MASTER_SB_ONLY flag is set. Some of
the descriptor blocks that should have been written out
were getting skipped.
Theodore Ts'o [Thu, 7 Nov 2002 21:16:55 +0000 (16:16 -0500)]
e2fsck.h, unix.c (main, check_mount): Fix e2fsck so that it
returns the appropriate exit code, so that the boot
scripts will be told that they need to automatically
reboot.
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.