There was a off-by-one fencepost error in the logic used to check if
we avoid copying zero-filled blocks when moving an inode table down by
a block or two. Thanks to valgrind for catching it. As far as I know
this fencepost error wasn't causing any actual problems, but it was
definitely a bug.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
correctly.
Update Makefile dependencies.
Update "make depend" production so that it filters out comments
inserted by newer gcc compilers.
Remove sync from e2fsck's "make all" target.
example, /tmp/test.img?offset=1024. Multiple options can separated using
the & character, although at the moment the only option implemented is
the offset option in the unix_io layer.
some generated files, by having subst update the modtime on these
files even when the generated file hasn't changed. We do this with
generated files that do not have any downstream dependencies.
non-empty bad block list. Resize2fs now discards any blocks on the
badblock list which are no longer part of the filesystem as the result
of a filesystem shrink. (Note: this means that shrinking and then
enlarging a filesystem is no longer a reversible operation;
information about bad blocks in the part of the filesystem
which is to be chopped off will be lost.)
parameter, and make the error and information messages
display explicitly the blocksize used by the filesystem,
to avoid confusion. (Addresses Debian bug: #189814)
Fix typo's in README.subset
Change debian control file so it doesn't bomb out if the EVMS FSIM
is not there, since it is not built on the Hurd. Resolves Debian
bug #189687.
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.
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).
than the requested size, then we will attempt to
transparently extend the filesize in a sparse fashion by
writing a block at the end of the requested part of the
filesystem.
main.c (main), resize2fs.c (resize_fs), resize2fs.h: Change the
function prototype of resize_fs() so that it can modify
the new_size parameter with the actual new size of the
filesystem after the resize operation. (This can
sometimes be less than the requested new size if there
isn't enough space to create the necessary block group
metadata for that last bit of disk space.) Resize2fs now
prints the actual new size of the filesystem when it finishes.
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.
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
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.
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.
Commit this file for future use; contains a configure.in script for when
libuuid gets separtead out into its own package.
libext2fs.texinfo:
Update version numbers for 1.19 release.
TODO:
Commit TODO list for 1.19 release.
README:
Update file for 1.19 release.
ChangeLog, e2fsprogs.spec:
e2fsprogs.spec: Merge in a few changes from the Red Hat 6.2 spec file,
now that we're using a modern rpm to build e2fsprogs. Also updated
version number to 1.19.
version.h:
Update version number for 1.19 release.
ChangeLog:
Check in changes for 1.19 release.
Makefile.in (install): Install resize2fs in /sbin, not /usr/sbin.
ChangeLog, unix.c:
unix.c: Also, re-arrange the logic so that we do the time check only
after doing the percentage check, and we only advance the spinner if
we're about to display it.
ChangeLog:
Fix minor wording error in Chagelog.
Update copyright of files in preparation for release of resize2fs.
Also removed the (obsolete) beta-test check that had been in the code,
as well as the old spec files used to package the separate
distribution of resize2fs.
Makefile.in: No longer build resize2fs.static, since there's no real
point in it any more.
Modified Files:
ChangeLog Makefile.in extent.c main.c resize2fs.8.in
resize2fs.c resize2fs.h sim_progress.c test_extent.c
Removed Files:
e2fsprogs-1.12.spec pq.gif resize2fs.spec version.h
badblocks.c, dumpe2fs.c, e2label.c, mke2fs.c, tune2fs.c, uuidgen.c:
For platforms that don't define optarg.h, manually define optarg and
optind.
ChangeLog, main.c:
main.c: For platforms that don't define optarg.h, manually define
optarg and optind.
ChangeLog, unix.c:
unix.c: For platforms that don't define optarg.h, manually define
optarg and optind.
Makefile.in (distclean): Remove TAGS and Makefile.in.old from the
source directory. Also, when making the .exclude file for the
source_tar_file, exclude those two files as well.
Makefile.in (distclean): Remove TAGS and Makefile.in.old from the
source directory.
message.c (safe_print): New function which prints strings, converting
non-printable characters using the '^' and M-notation. This function
is now used to print directory name entries and pathnames.
ChangeLog:
Update for release of E2fsprogs 1.14.
mk_cmds.sh.in: Fix error message so that it says mk_cmds's template
files instead of compile_et's template files.
ChangeLog, resize2fs.h:
resize2fs.h: Protect include of unistd.h with HAVE_UNISTD_H.
e2fsprogs.lsm:
Updated for 1.12 release.
pass1.c (process_inode_cmp): Use EXT2_QSORT_TYPE to define the
appropriate return type for comparison functions for qsort.
e2fsck.h: Add #ifdef protection for unistd.h
super.c: Remove header files already included by e2fsck.h
ChangeLog, dblist.c, ext2fs.h:
ext2fs.h: Define EXT2_QSORT_TYPE appropriately for the return type for
comparison functions for qsort.
dblist.c (dir_block_cmp): Use EXT2_QSORT_TYPE in function declaration.
ChangeLog, extent.c:
extent.c (ext2fs_create_extent_table): Use ext2fs_free_mem instead of
free().
(extent_cmp): Use EXT2_QSORT_TYPE to define the appropriate return
type for comparison functions for qsort.
ext2fs.h, bitops.h: Add support for the Watcom C compiler to do inline
functions.
ext2fs.h, dosio.c: Use asm/types.h instead of linux/types.h to evade a
potential problem with glibc's header files trying to spike out
linux/types.h.
ext2fs.h (ext2fs_resize_mem): Change the function prototype to include
the old size of the memory, which is needed for some braindamaged
memory allocation systems that don't support realloc().
badblocks.c (ext2fs_badblocks_list_add):
bb_inode.c (clear_bad_block_proc):
dblist.c (ext2fs_add_dir_block):
icount.c (insert_icount_el):
irel_ma.c (ima_put):
rs_bitmap.c (ext2fs_resize_generic_bitmap): Update functions to pass
the old size of the memory to be resized to ext2fs_resize_mem().
ChangeLog, dirinfo.c:
dirinfo.c (e2fsck_add_dir_info): Update function to pass the old size
of the memory to be resized to ext2fs_resize_mem().
ChangeLog, extent.c, resize2fs.c:
resize2fs.c (adjust_superblock):
extent.c (ext2fs_add_extent_entry): Update functions to pass the old
size of the memory to be resized to ext2fs_resize_mem().
Add substitution for @datadir@
ChangeLog, Makefile.in:
Change to use new installation directory variables convention. Fix
uninstall rules to take $(DESTDIR) into account. Remove cat8dir from
the installdirs target, since modern man package don't necessarily put
the cat directory in /usr/man/cat?.
ChangeLog, .del-types.h.in~7a460879:
types.h.in: Add a signed keyword to the __s64 definition.
main.c (main): Check to make sure we can really resize this
filesystem. If there are compatible feature sets that we don't
support, we need to abort.
resize2fs.c: Change to use the new prototype required by
block_iterate2 (which uses blkcnt_t for the blockcount).
version.h, RELEASE-NOTES:
Interim commit of changes to date.
resize2fs.c (inode_scan_and_fix): If we are expanding the filesystem,
temporarily set rfs->old_fs->super->s_blocks_count to ultimate size of
the filesystem, to avoid catching an error on the block iterator.
Change the name of the complete source file that we built (that
includes resize2fs) to be e2fsprogs-ALL-<version>.tar.gz. Don't link
with libuuid, since it's not needed.
resize2fs.8.in:
Add copyright statement.
Many files:
Update packaging for the resize2fs program.
resize2fs.c (blocks_to_move): Create the meta_bmap using the old
filesystem, not the new filesystem.
(get_new_block): Don't try checking the old block bitmap if the block
we're testing is beyond the boundaries of the old filesystem.
Makefile.in: Add rule to build a static version of resize2fs. Update
dependency rules.
main.c: #include ../version.h, instead of using a hard-coded version
string.
main.c (check_mount, main): Resize2fs now checks the size of the
partition, and uses this as a default new_size of the partition if one
is not specified. Resize2fs will not let you resize a mounted
partition.
resize2fs.c: Change how the progress function for the INODE_SCAN pass
is performed, so that the maximum size is never zero.
resize2fs.8.in: Updated man page.
Major reoganization of how resizing works. Functions in
ext2_block_move.c, and ext2_inode_move.c moved into resize2fs.c.
Multiple passes in those two files also combined into a single inode
scanning pass. Made the inode table moving function better handling
the case where it needs to abort mid-operation. When moving blocks
around, made the block allocation function preferentially avoid the
old group descriptor blocks, to make resize2fs more robust.
resize2fs.h: If EXT2_FLAT_INCLUDES is defined, then assume all
of the ext2-specific header files are in a flat directory.
ext2_block_move.c, ext2_inode_move.c, extent.c, resize2fs.c,
resize2fs.h: Rename variables named "new" to "new_block",
"new_inode", or "new_loc" to avoid C++ reserved word
clash.
ext2_block_move.c, ext2_inode_move.c, extent.c, resize2fs.c,
sim_progress.c: Use ext2fs_get_memory(),
ext2fs_free_memory(), et. al., instead of malloc() and
free().
ext2_block_move.c, ext2_inode_move.c, extent.c: Explicitly cast
all assignments from void * to be compatible with C++.
banalysis.c, banalysis.h, ext2_inode_move.c, ext2_block_move.c:
Change private to priv_data to avoid C++ namespace clash.
ChangeLog, badblocks.8.in:
badblocks.8.in: Add documentation for the -s option.
pass1.c, pass2.c, pass3.c, pass4.c, pass5.c: Add calls to the progress
indicator function.
pass1.c (scan_callback): Add call to the progress feedback function
(if it exists).
super.c (check_super_block): Skip the device size check if the
get_device_size returns EXT2_EXT_UNIMPLEMENTED.
iscan.c (main): Don't use fatal_error() anymore.
pass1b.c, swapfs.c, badblocks.c: Set E2F_FLAG_ABORT instead of calling
fatal_error(0).
problem.c, pass3.c (PR_3_ROOT_NOT_DIR_ABORT,
PR_3_NO_ROOT_INODE_ABORT): New problem codes.
problem.c, pass2.c (PR_2_SPLIT_DOT): New problem code.
problem.c, pass1.c (PR_1_SUPPRESS_MESSAGES): New problem code.
problemP.h: New file which separates out the private fix_problem data
structures.
util.c, dirinfo.c, pass1.c, pass1b.c, pass2.c, pass5.c, super.c,
swapfs.c util.c: allocate_memory() now takes a e2fsck context as its
first argument, and rename it to be e2fsck_allocate_memory().
problemP.h:
New file which contains the private problem abstraction definitions.
Makefile.pq:
Remove include of MAKEFILE.STD, which doesn't exist at this point.
resize2fs.c, ext2_block_move.c ext2_inode_move.c: Only include printf
statements if RESIZE2FS_DEBUG is defined.
main.c: Don't read in the bitmaps since resize2fs.c does that.
e2label.c, mke2fs.c:
Adjust header files.
Rename new error codes to _ET_ in them for consistency.
ChangeLog, et_c.awk, et_h.awk:
Remove support for non STDC compilers, since the workarounds caused
problems with the header file.
Makefile.pq:
Checkpoint of powerquest work.
Allow people to set the version.h to something like 1.10-PLUS.
.del-inodemap.c~24510e64, main.c, resize2fs.c, resize2fs.h:
More interim work. All is functioning except progress meter.
bmove.c (ext2fs_move_blocks): New function which takes a bitmap of
blocks which need to be moved, and moves those blocks to another
location in the filesystem.
rs_bitmap.c (ext2fs_resize_generic_bitmap): When expanding a bitmap,
make sure all of the new parts of the bitmap are zero.
bitmaps.c (ext2fs_copy_bitmap): Fix bug; the destination bitmap wasn't
being returned to the caller.
alloc_tables.c (ext2fs_allocate_group_table): Add new function
ext2fs_allocate_group_table() which sets the group tables for a
particular block group. The relevant code was factored out of
ext2fs_allocate_tables().
dblist.c (make_dblist): Adjust the initial size of the directory block
list to be a bit more realize (ten plus twice the number of
directories in the filesystem).
Check in interim work.
configure.in (rmakefile): Added (optional) private directory for resize2fs.
Makefile.in: Change recursive descent rules to check to see if a
directory exists before trying to make it.
Many files:
Initial checkin of work done to date.