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)
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).
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.
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.
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...
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.
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.
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.
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).
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).
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.
Add support for the TEA hash.
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().
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....
8192-byte and 16384-byte blocksize filesystems.
Change the default bytes-per-inode ratio of a new filesystem to be at most
one inode per block for large blocksizes.
Pratt. Fixed a selection bug and added checks to make
sure volumes are not mounted when creating the list of
volumes which can be mkfs'ed by the ext2/3 plugin.
the EXT2_SB() macro instead. Remove kernel function
prototypes also. This matches the 2.5 kernel, and
is also cleaner for other reasons. Whitespace cleanup.
mapping for a particular inode.
Fixed a bug in the libext2 library which broke ext2fs_bmap if no inode structre
was passed inside for here.
Fixed bad calling parameters to parse_ulong which broken the -b and -s
options to debugfs, as well as do_init, and the testb, setb, clearb functions.
file we are checking is a block device file before looking
at st_rdev, since it's not valid for normal files.
(is_swap_device): Move so that it is outside the
HAVE_MNTENT_H, so that it is always built.
functions which take an extra flags argument. The flag
EXT2_DIRBLOCK_V2_STRUCT will reverse when the name_len
field is byte swampped on big-endian machines, since in
the V2 structure, name_len is a char field which is
doesn't need to be byte swapped --- except if an
old-style kernel had byte-swapped the name_len field
as part of the V1 structure.
Also fixed a bug in debugfs which used ext2_dir_entry_2 without
worrying about the above issue, with the net result that "ls -l"
would print an incorrect file type on big-endian systems.
an I/O object.
Export ext2_file_flush as a public interface.
Also minor cleanups to tighten code in other I/O abstractions, and to
mark a void * pointer as const in the ext2_file_write interface.
Add support for a new flag, DIRENT_FLAG_INCLUDE_REMOVED,
which will return deleted directory entries.
ext2fs_dir_iterate2 takes a new callback function which
is identical with the one used by
ext2fs_dblist_dir_iterate(). If the directory entry is
deleted, the callback function will be called with the
entry paraemter set to DIRENT_DELETED_FILE.
Makefile.in, alloc_stats.c (ext2fs_inode_alloc_stats,
ext2fs_block_alloc_stats): New functions which update
block/inode allocation statistics in the bitmaps, block
group descriptors, and superblock.
mkjournal.c (mkjournal_proc), mkdir.c (ext2fs_mkdir),
expanddir.c (expand_dir_proc), bb_inode.c
(clear_bad_block_proc, set_bad_block_proc,
ext2fs_update_bb_inode), alloc.c (ext2fs_alloc_block):
Update to use new block/inode allocation statistics.
ext2fs_check_if_mounted and ext2fs_check_mount_point which
determines whether or not the specified device is a swap
device by using /proc/swaps. More bulletproofing for
idiotic/careless system administrators!
since files which get dropped into that directory may have come
from a protected directory, and the system administrator may not
deal with immediately. (Addresses Debian bug #118443)
- Renamed linux/list.h to be linux/linked_list.h to work around a
problem caused by diet libc insistence to search the kernel
header files ahead of all other files in the include path,
including the user specified include files.
- Worked around a bug in diet libc which core dumps when using
putc with stderr by using fputs instead. As a bonus, this
also shaved a few bytes off of com_err.o.
- Fixed a real bug in debugfs which was detected because diet libc
was more sensitive than glibc when incorrectly using fclose()
where pclose() is required.
trying to unset the filesize limit if at all possible,
if a block device is getting opened. (The filesize limit
shouldn't be applied against writes to a block device, but
starting in 2.4.10, the kernel is doing this.)
file on adding a journal to an already-mounted filesystem,
try to clear the ext2 file attributes on an already
existing .journal file so that we don't fail if on a
partially added journal to the filesystem.
which signals that a particular inode should not have the
last bits of data (the "tail") be merged with another
file. This is necessary to keep programs like LILO happy.
Add a copyright statement to the libuuid man page which identifies it
as being under LGPL. While this is conveyed in the source code, it is
not mentioned anywhere in the man pages or other documentation.
/etc/mtab to make sure the filesystem is really mounted,
since some broken distributions (read: Slackware) have
buggy boot scripts that don't initialize /etc/mtab before
checking non-root filesystems. (Slackware also doesn't
check the root filesystem separately, and reboot if the
root filesystem had changes applied to it, which is
dangerous and broken.)
the a valid .info file can be made. Use @deftypefun to
define functions. Change the e-mail address where bug
reports to be sent to be is the e2fsprogs maintainer.
isnull.c (uuid_is_null), pack.c (uuid_pack),
parse.c (uuid_parse), unpack.c (uuid_unpack),
unparse.c (uuid_unparse), uuid.h, uuidP.h,
uuid_time.c (uuid_time, uuid_type, uuid_variant):
Use const for pointer variables that we don't modify. Add
the appropriate ifdef's in uuid.h to make it be C++ friendly.
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.
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).
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.)
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.
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...)
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.
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.
Makefile.in: Limit some .o files from being included into the library
if --disable-debugfs, --disable-swapfs, --disable-imager, or
--disable-resizer are used.
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.
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.
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.
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.
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.
Makefile.in: Move include/asm/types.h.in to lib/ext2fs/ext2_fs.h.in.
wordwrap.pl: Add some rules which help fix up the dependencies.
Many files:
Move include/asm/types.h.in to lib/ext2fs/ext2_fs.h.in.
ismounted.c: More cleanups for ismounted.c, some from Andreas, some to
clean up Andreas's patches. Use strncpy instead of strcpy to save the
root's mountpoint. Clean up #ifdef structure. Remove uneeded
variable in testing/debug driver.
ismounted.c: Add check for root device which doesn't depend on
/etc/fstab or /proc/mounts to be correct. Don't call endmntent()
before we are done with mnt struct.
ext2_fs.h: Change assignment of EXT2_FEATURE_COMPAT_DIR_INDEX to make
room for pre-existing usage of EXT2_FEATURE_COMPAT_EXT_ATTR. Add flag
EXT2_INDEX_FL with the same codepoint as EXT2_BTREE_FL.
ext2fs.h: #include <> instead of "" for ext2fs and et header files,
since they will be installed in /usr/include
ChangeLog, e2p.h:
e2p.h: #include <> instead of "" for ext2fs and et header files, since
they will be installed in /usr/include
badblocks.c, chattr.c, dumpe2fs.c, e2image.c, findsuper.c, lsattr.c,
mke2fs.c, mklost+found.c, tune2fs.c, util.c: Change location of
ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, resize2fs.h:
resize2fs.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, debugfs.h:
debugfs.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, e2fsck.h, scantest.c:
e2fsck.h, scantest.c: Change location of ext2_fs.h to be
ext2fs/ext2_fs.h
ChangeLog, Makefile.in, tst_uuid.c, uuid_time.c:
tst_uuid.c, uuid_time.c: Remove unneeded #include of ext2_fs.h
ChangeLog, Makefile.in, e2p.h:
e2p.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, test_icount.c, test_rel.c:
test_icount.c, test_rel.c: Change location of ext2_fs.h to be
ext2fs/ext2_fs.h
ls.c (print_features): Added missing space when printing (none) as the
filesystem feature.
(list_super2): If the filesystem revision is unknown, say so.
fileio.c (ext2fs_file_read): Factored out common code and cleaned up
function. Fixed a bug where if there was an error reading from the
disk, the number of bytes read wasn't reliably set. (Fixes Debian bug
#79163)
(ext2fs_file_write): Factored out common code and made function more
efficient; if writing a full block, don't bother to do a
read-modify-write cycle.
dirblock.c (ext2fs_read_dir_block): Check for an directory record
length which isn't a multiple four, and treat that as an invalid.
Scan the directory and return an error (EXT2_ET_DIR_CORRUPTED) if the
directory records are orrupted.
(ext2fs_write_dir_block): If while byte-swapping the directory block,
if there's an error, abort and return EXT2_ET_DIR_CORRUPTED.
ext2fs.h (EXT2_FLAG_IMAGE_FILE): Add new flag, and add image_header
field in the ext2_filsys structure
block.c (block_iterate_ind, block_iterate_dind, block_iterate_tind):
inode.c (ext2fs_read_inode):
rw_bitmaps.c (read_bitmaps):
openfs.c (ext2fs_open): Add support for EXT2_FLAG_IMAGE_FILE
imager.c (ext2fs_image_bitmap_read): Fix bug in imager to make sure
the full bitmap is saved.
dir_iterate.c (ext2fs_process_dir_block): Add a double-check to make
sure the rec_len is a multiple of 4, to prevent bus-errors on
architectures which care about mis-aligned pointer references.
parse.c, compare.c: Include string.h to fix gcc -Wall complaints.
gen_uuid.c: Define _SVID_SOURCE to avoid gcc -Wall errors because some
required structures wouldn't be otherwise defined. Fix a minor gcc
-Wall nit in the declaration of get_random_fd().
ismounted.c (check_mntent): Check /proc/mounts on Linux systems before
checking /etc/mtab. The EXT2_MF_READONLY flag is now set from the
/etc/mtab options field for all filesystems, not just the root
filesystem. Add debugging code to make it easier to test
ext2fs_check_if_mounted().
mkjournal.c (ext2fs_create_journal_superblock): Add safety check;
return an error if there's an attempt to create a journal less than
1024 filesystem blocks.
ext2_err.et.in, mkjournal.c: Change EXT2_JOURNAL_NOT_BLOCK and
EXT2_NO_JOURNAL_SB to be EXT2_ET_*.
bitops.h (ext2fs_swab16, ext2fs_swab32): Add i386 assembly inline
functions.
tst_byteswap.c: New function to test the byteswap functions. Add to
regression test suite.
mkjournal.c (ext2fs_create_journal_superblock): Fix the setting of
s_first for external devices to always be 1, since jsb->s_first is
always relative to the start of the journal superblock. Use htonl(1)
when setting s_nr_users.
mkjournal.c (ext2fs_add_journal_device): Fix bug where the device
number of the filesystem (instead of the journal) was being dropped
into s_journal_dev.
ChangeLog, dumpe2fs.c:
dumpe2fs.c (print_journal_information): Use s_first_data_block to find
the correct block to read the journal superblock.
initialize.c (ext2fs_initialize): Add support for initializing the
ext2 superblock for external journal devices. This basically means we
don't bother to allocate any block group descriptors.
openfs.c (ext2fs_open): Only open external journal devices if the new
flag EXT2_FLAG_JOURNAL_DEV_OK is passed to ext2fs_open. When opening
such devices, don't try to read the block group descriptors, since
they're not there.
ext2_err.et.in (EXT2_NO_JOURNAL_SB): Add new error code
mkjournal.c: Export a new function,
ext2fs_create_journal_superblock(), which allocates and returns a
buffer containing a journal superblock. This is needed by mke2fs to
create an external journal. Rewrote ext2fs_add_journal_device() so
that it no longer creates the external journal, but rather adds a
filesystem to an existing external journal. It handles all of the
UUID manipulation.
ext2fs.h: List the EXT3_FEATURE_JOURNAL_DEV as a flag supported by the
library. Define the EXT2_FLAG_JOURNAL_DEV_OK. Changed function
prototype for ext2fs_add_journal_device().
feature.c: Remove backward compatibility #ifdef's for old ext2_fs.h
header files.
.del-ext2_fs.h~7a460879, ChangeLog:
ext2_fs.h (EXT3_FEATURE_INCOMPAT_JOURNAL_DEV): Add definition for use
with external journal devices.
tune2fs.c (add_journal): Minor fixes from Andreas Dilger. Flush stdout
after printing in-progress message.
(main): Exit with status code 1 if we failed to determine the mount
status of the device.
ChangeLog, gcc-wall-cleanup:
gcc-wall-cleanup: Remove additional annoying warning messages emited
by gcc 2.95.2.
ChangeLog, uuid.h:
uuid: Change arguments to make it clear which argument is the source
and which is the destination.
uuid_time.c (main), tst_uuid.c (main): Fix gcc -Wall complaints.
copy.c (uuid_copy): Change arguments to make it clear which argument
is the source and which is the destination.
gen_uuid.c (get_random_fd): Use gettimeofday to seed the PRNG, so we
can take advantage of tv_usec to do (slightly) better at seeding it.
MCONFIG.in: Change --enable-gcc-wall handling so that it's no longer a
configure option, but something which is done when the developer uses
the command "make gcc-wall".
configure.in: Remove test for ino_t, since we don't use it any more
(we always use our own ext2_ino_t). Remove --enable-gcc-wall support.
Add test for sys/ioctl.h
.del-types.h.in~ca55114a:
Remove definition of ino_t
ChangeLog, Makefile.in, ext2fs.h, flushb.c, jump.funcs:
flushb.c (ext2fs_sync_device): New function which centralizes all of
the places which might try to use the BLKFLSBUF or FDFLUSH ioctls (and
usually failing to define them since the system header files don't
usually do this for us, and we're trying to avoid usage of kernel
include files now.)
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
dirblock.c (ext2fs_read_dir_block): Fix a potential case where we may
overrun allocated memory in case of a corrupted filesystem (or an
e2fsck test case :-) when byte-swapping the directory block.
mkjournal.c (ext2fs_add_journal_device): Fix various gcc -Wall
complaints including a missing return 0 at the end of
ext2fs_add_journal_device.
ChangeLog, ext2fs.h:
ext2fs.h: Indent the #warning to fix gcc -Wall complaint.
Makefile.in: Link in libe2p when creating libext2fs as a shared
library, since mkjournal.c now references fsetflags().
mkjournal.c (ext2fs_add_journal_inode): Folded in Andreas Dilger's
changes (with fixups) to allow on-line creation of a journal file.
.del-types.h.in~ca55114a:
Change what we use to protect the header file to be _ASM_TYPES_H
instead of _LINUX_TYPES_H. (Needed to make libc5 builds happy).
version.h:
Update for WIP release.
ismounted.c: add ext2fs_check_mount_point() function, which will
optionally return the mount point of a device if mounted
ChangeLog, closefs.c, ext2fs.h:
ext2fs.h, closefs.c (ext2fs_flush): Add new flag,
EXT2_FLAG_SUPER_ONLY, which the close routines to only update the
superblock, and not the group descriptors.
ext2fs.h: Remove definition of ext2fs_sb. Note: this may break source
(but not binary) compatibility of some users of the ext2 library.
They should just simply do a global search and replace of struct
ext2fs_sb with struct ext2_super_block, and use their own private copy
of ext2_fs.h if they aren't already.
closefs.c, initialize.c, link.c, newdir.c, openfs.c, swapfs.c: Replace
use of ext2fs_sb with ext2_super_block.
ChangeLog, main.c:
main.c (main): Replace use of struct ext2fs_sb with struct ext2_super_block.
ext2fs.h: Cleaned up header file by removing definitions of feature
flags that might not have been defined in older ext2 header files.
Now that we're using our own include/linux/ext2fs.h header file, this
can never happen.
jfs_dat.h: Removed old header file which is no longer needed.
ChangeLog:
jfs_compat.h: Remove uneeded header file.
ext2fs.h, mkjournal.c (ext2fs_add_journal_fs,
ext2fs_add_journal_device): Add a new argument to the APIs of these
function, which is a flags word. This is used to allow the creation
of a V1 superblock for those folks who are using ext3 0.3b in
production. Note, the user-land interface for getting at this flag
won't be documented, as the V1 superblock is deprecated.
jfs_e2fsck.h, jfs_user.h: Replaces jfs_compat.h. The jfs.h file has
been moved to the include/linux directory.
journal.c, revoke.c, recovery.c: Updated files from Stephen to support
the V2 superblock and revoke processing. The journal.c and revoke.c
files are copies from the ext3 kernel source.
Makefile.in: Added revoke.c to the list of source/object files.
Makefile.in:
Fix up some mistakes in the source file list, and regenerate the
dependencies.
Update Makefile dependencies.
ChangeLog, jfs.h:
jfs.h: Remove excess #include of JFS_DEBUG. Not needed for e2fsprogs,
since we optioanlly define it in the configuration file system.
mkjournal.c (init_journal_superblock): Sync Stephen's changes which
creates a V2 superblock instead of a V1 superblock.
ChangeLog, jfs.h, jfs_compat.h, list.h:
jfs.h, jfs_compat.h, list.h: New files added to support ext3.
fgetflags.c (fgetflags):
fgetversion.c (fgetversion):
fsetflags.c (fsetflags):
fsetversion.c (fsetversion): Use the LFS API if available so that the
files are opened with O_LARGEFILE. Addresses Debian bug #72690.
imager.c (ext2fs_image_{inode,super,bitmap}_{read,write}, ext2_fs.h,
Makefile.in: New file that has routines that save ext2fs metadata to a
file.
ext2_err.et.in (EXT2_ET_MAGIC_E2IMAGE): New error code assigned.
e2image.h: New file which defines the file format for the ext2 image
file. (Saved copy of ext2 metadata to a file as a saving throw
against worst-case damage.)
ChangeLog, Makefile.in, e2image.c:
e2image.c, Makefile.in: New program which saves ext2 metadata to a
file for people who need a last-ditch saving throw.