Andreas Dilger [Sat, 4 Aug 2001 06:51:18 +0000 (00:51 -0600)]
Add extra checks for bad symlinks, including zero length symlinks,
too long i_size for slow and fast symlinks, i_size_high set, multiple
blocks for slow symlinks.
tune2fs.c (update_feature_set, remove_journal_inode): If
removing an in-filesystem journal, clear out the journal
inode and update the filesystem accounting structures so
we don't have to run e2fsck to clean up after ourselves
unix.c (check_mount): Remove the code in e2fsck which tested for the
root filesystem being mounted read-only, and depend on the
results flags from ext2fs_check_if_mounted.
mkjournal.c (ext2fs_create_journal_superblock): Set the first block
usable in the journal for external journals to be 2 or 3,
depending on the blocksize, so that the existing kernel code
does the right thing.
getsize.c (ext2fs_get_device_size): Add support for the
BLKGETSIZE64 ioctl. (Ioctl defined by unofficial patches
from Ben LaHaise, but it's likely this interface won't
change.)
mkjournal.c (ext2fs_add_journal_device): Use the correct block
when writing the journal superblock, too. (Oops! Needed
to make 1k filesystems with external journal to work.)
This patch completes the initial extended attribute/ACL support for
e2fsck. We now check the entire EA block to make sure that the all
of the EA entries look sane.
Speed up journal recovery in userspace by avoiding a pointless
unconditional ext2_flush() call. Also made ext2_flush() more
efficient when the superblock is modified after the filesystem has
been flushed, and make it clear the superblock dirty flag
after doing the superblock/block group descriptor flush.
pass1b.c (pass1b, process_pass1b_block): Change the num_bad
field calculation so that it only counts EA block entries
as a single multiply claimed block (since once we clone
the EA blocks for one inode, we fix the problem for all of
the other inodes). Also, I moved the num_bad calculation
from process_pass1b_block to the end of pass1b. This
fixes a *significant* performance bug in pass1b which hit
people who had to had a lot of multiply claimed blocks.
(Can you say O(n**3) boys and girls? I knew you could...
Fortunately, this case didn't happen that much in actual practice.)
pass1.c (e2fsck_pass1): Defer inodes which have an extended attribute
block for later processing to avoid extra seeks across the disk.
(process_inode_cmp): If there is no indirect block, sort by the
extended attribute (i_file_acl) block.
pass1b.c (clone_file_block): Fix bugs when cloning extended attribute
blocks. Moved free of block_buf to after the code which clones the
extattr block, and fixed logic for changing pointers to the extended
attribute field in the inodes which were affected.
(decrement_badcount): New function which is used whenever we need to
decrement the number of files which claim a particular bad block.
Fixed bug where delete_file wasn't checking check_if_fs_block() before
clearing the entry in block_dup_map. This could cause a block which
was claimed by multiple files as well as the filesystem metadata to
not be completely fixed.
Theodore Ts'o [Sat, 23 Jun 2001 01:52:14 +0000 (21:52 -0400)]
mkjournal.c (ext2fs_add_journal_inode): Move close of file
descriptor so that adding a journal to a mounted
filesystem doesn't die. (Fixes a bug accidentally
introduced in e2fsprogs 1.21.)
Theodore Ts'o [Sat, 23 Jun 2001 01:20:47 +0000 (21:20 -0400)]
mkjournal.c (ext2fs_add_journal_inode): Only use fchflags if
HAVE_CHFLAGS and UF_NODUMP are defined, since the Hurd has
fchflags without defining UF_NODUMP. (Addresses Debian
bug #101361)
Theodore Ts'o [Sat, 23 Jun 2001 01:01:17 +0000 (21:01 -0400)]
e2fsck/flushb.c and lib/ext2fs/flushb.c: Use platform independent
method of defining the BLKFLSBUF and FDFLUSH ioctl's.
Also include sys/mount.h since on newer glibc's BLKFLSBUF
is defined there.
Theodore Ts'o [Sat, 23 Jun 2001 00:54:11 +0000 (20:54 -0400)]
bitops.h: The C language versions of ext2fs_swab16/32 need to be
included if EXT2FS_ENABLE_SWAPFS is defined, since we need to support
byte swapping even if we don't support the conversion functions.
(Fixes Debian bug #101686).
Theodore Ts'o [Sat, 23 Jun 2001 00:40:51 +0000 (20:40 -0400)]
dirblock.c (ext2fs_read_dir_block): Remove use of dir_entry_2 since
the byte-swapping code all assumes the ext2_dir_entry structure.
(It's a question of whether or not name_len should be byte-swapped or
not, and whether it's a 16 bit or 8 bit field.)
Theodore Ts'o [Sat, 23 Jun 2001 00:35:38 +0000 (20:35 -0400)]
super.c (release_inode_blocks): Don't try to release the blocks if the
orphaned inode is a device file, symlink, or some other kind of
special file that doesn't have a block list.
Theodore Ts'o [Fri, 15 Jun 2001 22:54:34 +0000 (22:54 +0000)]
Many files:
Synchronize with the Debian package 1.20+1.21-WIP-0614-1.
RELEASE-NOTES, version.h, libext2fs.texinfo, e2fsprogs.lsm:
Update for 1.21 release.
Theodore Ts'o [Fri, 15 Jun 2001 22:44:32 +0000 (22:44 +0000)]
ChangeLog, Makefile.in:
Makefile.in: Fix bug in installation of ext2_types.h. It is a file
which is generated and is therefore found in the build directory, not
source directory.
Theodore Ts'o [Fri, 15 Jun 2001 18:33:43 +0000 (18:33 +0000)]
ChangeLog, ismounted.c:
ismounted.c (check_mntent_file): Use a test file in / to check to see
if the root filesystem is mounted read-only. This protects against
the case where /etc might not be on /, as well as the case where
/etc/mtab doesn't exist. (Both are should-never happen scenarios, but
you never know...)
Theodore Ts'o [Thu, 14 Jun 2001 07:00:55 +0000 (07:00 +0000)]
ChangeLog, ismounted.c:
ismounted.c (ext2fs_check_if_mounted): Fix grammer in comment. Remove
unneeded #pragma argsused, since the arguments are always used.
Theodore Ts'o [Thu, 14 Jun 2001 06:42:44 +0000 (06:42 +0000)]
ChangeLog, mke2fs.c, tune2fs.8.in, tune2fs.c, util.c, util.h:
tune2fs.c, mke2fs.c, util.c, util.h (print_check_message): Move the
message which displays how often the filesystem will be checked from
mke2fs into a utility subroutine. Then cause tune2fs to call that
function to display the message after adding a journal to a
filesystem.
mke2fs.8.in: Add manual page fixups and explanation for why it's good
to check filesystems periodically from Andreas Dilger.
Theodore Ts'o [Thu, 14 Jun 2001 01:16:17 +0000 (01:16 +0000)]
ChangeLog, unix.c:
unix.c (check_if_skip): Adapted patch from Andreas Dilger which prints
the number of mounts or days elapsed since the last check when e2fsck
is forced to check an otherwise clean filesystem.
Theodore Ts'o [Thu, 14 Jun 2001 00:24:42 +0000 (00:24 +0000)]
ChangeLog, ext2_types.h.in:
ext2_types.h.in: If linux/types.h has been defined, then don't try to
redefine the typedefs.
ChangeLog, Makefile.in:
Makefile.in: Make the install target depend on $(SUBS) to accomodate
the fools who want to compile and install e2fsprogs as root using just
one command.
Theodore Ts'o [Wed, 13 Jun 2001 23:46:39 +0000 (23:46 +0000)]
ChangeLog, setsuper.c:
setsuper.c: Add s_lastcheck field to the fields which can be modified
using set_super_value. (Suggested by Andreas Dilger)
ChangeLog, Makefile.in:
Makefile.in (HFILES): Add ext2_types.h to the list of files which
should be installed.
Theodore Ts'o [Wed, 13 Jun 2001 22:38:56 +0000 (22:38 +0000)]
ChangeLog, Makefile.in:
Makefile.in: Limit some .o files from being included into the library
if --disable-debugfs, --disable-swapfs, --disable-imager, or
--disable-resizer are used.
Theodore Ts'o [Wed, 13 Jun 2001 22:16:47 +0000 (22:16 +0000)]
ChangeLog, configure, configure.in:
configure.in: Add --disable-resizer, --disable-imager, and
--disable-debugfs switches, which allow people who are building boot
floppies to build a very restricted e2fsprogs distribution. Note:
these functions limit the functions in the shared library, so beware!
Makefile.in, ChangeLog:
Makefile.in: Don't recurse into debugfs and resize subdirectory if
--disable-debugfs or --disable-resizer is given as a configuration
option.
ChangeLog, Makefile.in:
Makefile.in: Don't build e2image if --disable-imager is specified to
configure.
Theodore Ts'o [Wed, 13 Jun 2001 00:12:04 +0000 (00:12 +0000)]
ChangeLog, dumpe2fs.c, mke2fs.c:
dumpe2fs.c: Use WORDS_BIGENDIAN to determine whether or not we're
(not) using i386 byte order.
dumpe2fs.c, mke2fs.c: Stop using the compatibility badblocks function,
and use the ext2fs_badblocks_* functions instead.
ChangeLog, inode.c, tst_iscan.c:
inode.c, tst_iscan.c: Stop using the compatibility badblocks function,
and use the ext2fs_badblocks_* functions instead.
ChangeLog, badblocks.c:
badblocks.c: Stop using the compatibility badblocks function, and use
the ext2fs_badblocks_* functions instead.
Theodore Ts'o [Tue, 12 Jun 2001 22:35:00 +0000 (22:35 +0000)]
ChangeLog, fsck.c:
fsck.c (device_already_active): Fixed bug which can cause fsck to core
dump if there are a mix of devices with standard and non-standard
names.
Theodore Ts'o [Mon, 11 Jun 2001 15:17:45 +0000 (15:17 +0000)]
ChangeLog, Makefile.in, bitops.h, gen_bitmap.c:
Makefile.in, gen_bitmap.c, bitops.h: Move inline functions
ext2fs_mark_generic_bitmap and ext2fs_unmark_generic_bitmap to
gen_bitmap.c as normal functions. (This saves space and doesn't
significantly change the speed of e2fsck on a P-III.)
ChangeLog:
Add missing log entry for unix.c.
Theodore Ts'o [Mon, 11 Jun 2001 07:00:04 +0000 (07:00 +0000)]
ChangeLog, Makefile.in, swapfs.c, unix.c:
Makefile.in: Add message.c and swapfs.c to the list of source files to
build the make depend.
swapfs.c, unix.c: Only support the -s and -S options to e2fsck if
ENABLE_SWAPFS is defined.
Many files:
ext2fs.h, bitops.h, block.c, bmap.c, closefs.c, dirblock.c, inode.c,
native.c, openfs.c, rw_bitmaps.c, swapfs.c: Only include the
byte-swapping logic if ENABLE_SWAPFS is turned on or if we're on a
big-endian machine.
initialize.c (ext2fs_initialize):Use WORDS_BIGENDIAN directly to set
EXT2_FLAG_SWAP_BYTES, instead of using ext2fs_native_flag.
native.c (ext2fs_native_flag): Use WORDS_BIGENDIAN provided by
autoconf to determine whether or not return EXT2_FLAG_SWAP_BYTES.
Theodore Ts'o [Mon, 11 Jun 2001 06:54:13 +0000 (06:54 +0000)]
ChangeLog, configure, configure.in:
configure.in: Add new switch, --disable-swapfs which disables support
of byte-swapping old filesystems. Add new test, AC_C_BIGENDIAN, which
sets WORDS_BIGENDIAN on big-endian machines. Change handling of
--with-ccopts so that if set, the default CFLAGS is suppressed.
Theodore Ts'o [Mon, 11 Jun 2001 00:49:29 +0000 (00:49 +0000)]
ChangeLog, Makefile.in, mkjournal.c:
Makefile.in: Remove the dependence on the libe2p library.
mkjournal.c (ext2fs_add_journal_inode): Replace use of fsetflags with
direct usage of the ioctl/fchflags so that we don't have to depend on
the libe2p library.
Theodore Ts'o [Fri, 8 Jun 2001 09:43:40 +0000 (09:43 +0000)]
ChangeLog, icount.c:
icount.c (insert_icount_el): Fix the code used to estimate the size of
the new icount array to be more intelligent, to avoid reallocating the
array too many times.
ChangeLog, ext2_types.h.in:
ext2_types.h.in: Use unsigned ints in favor of unsigned longs when
trying to find a 32-bit wide type.