Commit Graph

379 Commits (master)

Author SHA1 Message Date
Theodore Ts'o 63feaa13ab resize2fs.8: Make it clear that power-of-2 units are meant by kilobytes
It's sad that this needs to be made clear....

Addresses-Debian-Bug: #594004

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-25 20:24:18 -04:00
Theodore Ts'o db0bdb49f4 Merge branch 'maint' into next
Conflicts:
	resize/extent.c
2010-07-19 02:37:41 -04:00
Theodore Ts'o b344ed7bc3 resize2fs.8: Update man page to indicate ext4 supports on-line resize
Addresses-Debian-Bug: #589345

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-19 02:23:12 -04:00
Eric Sandeen 8587d393b0 resize2fs: relax requirements for -P output a bit
Requiring an immediate pre-fsck before printing a minimum
resize size seems a bit draconian; if the fs isn't clean or marked
with error, then certainly, but for an informational minimum
size, I don't think we need to require a fsck since last mount.

I had simply copied the checks from the actual resize path,
previously.

Installers use this option (-P) to gather minimum resize info,
and requiring an actual fsck before use just seems to go too far.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-07-17 06:36:26 -04:00
Theodore Ts'o ac92f3cc04 e2fsck, resize2fs: fix a fp precision error that can lead to a seg fault
Commit 641b66b fixed a floating point precision error which can result
in a search algorithm looping forever.  It can also result in an array
index being out of bounds and causing a segfault.  Here are two more
cases in e2fsck and resize2fs that need to be fixed.  I've just used
the same fix from the that commit.

Signed-off-by: Lachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-05 20:40:41 -04:00
Valerie Aurora Henson 8728d50657 resize2fs: Fix up to be 64-bit block number safe
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-06-13 18:00:00 -04:00
Theodore Ts'o 97d26ce9e3 Merge branch 'maint' into next
Conflicts:
	e2fsck/journal.c
	e2fsck/pass1.c
	e2fsck/pass2.c
	misc/mke2fs.c
2010-06-07 12:42:40 -04:00
Eric Sandeen 5fa92bc768 resize2fs: don't print minimum size if fs is not clean
Right now, resize2fs -P on a dirty filesystem will give you a number;
however, it's probably wrong if the fs is not clean:

# resize2fs -P myimage.img
resize2fs 1.41.9 (22-Aug-2009)
Estimated minimum size of the filesystem: 75623

# e2fsck -fy myimage.img
e2fsck 1.41.9 (22-Aug-2009)
myimage.img: recovering journal
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

myimage.img: ***** FILE SYSTEM WAS MODIFIED *****
myimage.img: 9530/53760 files (0.1% non-contiguous), 24737/98304 blocks

# resize2fs -P myimage.img
resize2fs 1.41.9 (22-Aug-2009)
Estimated minimum size of the filesystem: 32165

We should issue the same "Please run e2fsck ..." message for
-P as we do for an actual resize request.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-05-12 12:44:56 -04:00
Theodore Ts'o cc84d866e2 Merge branch 'maint' into next
Conflicts:
	e2fsck/pass1.c
2010-02-10 18:20:58 -05:00
Theodore Ts'o 4828bbe9e7 resize2fs: Fix fix uninit group test accessing invalid memory
Commit 74128f8 added tests for uninit groups, but it could access past
the end of the group_desc[] array after processing the last group:

==19668== Invalid read of size 2
==19668==    at 0x40518C: resize_fs (resize2fs.c:1824)
==19668==    by 0x405A46: main (main.c:451)
==19668==  Address 0x5a0d002 is not stack'd, malloc'd or (recently) free'd
==19668==
==19668== Invalid read of size 2
==19668==    at 0x405391: resize_fs (resize2fs.c:1864)
==19668==    by 0x405A46: main (main.c:451)
==19668==  Address 0x5a0d002 is not stack'd, malloc'd or (recently) free'd
==19668==

It was found by Eric Sandeen running the regression suite through
valgrind.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-02-05 22:50:19 -05:00
Theodore Ts'o 4486af5b4c Merge branch 'maint' into next
Conflicts:
	misc/mke2fs.c
2009-11-16 00:30:57 -05:00
Eric Sandeen d93d5bbf60 resize2fs: exit fix_sb_journal_backup early for external journal
Resizing a filesystem with an external journal fails when it tries
to read inode 0:

# touch testfs
# truncate testfs 1342177280
# touch testjournal
# truncate testjournal 134217728
# mke2fs -O journal_dev testjournal
# losetup /dev/loop0 testjournal
# mkfs.ext4 -J device=/dev/loop0 testfs 127680
# resize2fs testfs
resize2fs 1.41.9 (22-Aug-2009)
Resizing the filesystem on testfs to 327680 (4k) blocks.
resize2fs: Illegal inode number while trying to resize testfs
Please run 'e2fsck -fy testfs' to fix the filesystem
after the aborted resize operation.

I think the right, simple thing to do is just bail out early
for an external journal here, as there are no backup blocks
to update.

Reported-by: mjevans1983@gmail.com
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-12 19:46:56 -05:00
Theodore Ts'o 6493f8e85d Convert ext2fs_group_of_blk() to ext2fs_group_of_blk2()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-25 20:50:15 -04:00
Valerie Aurora Henson 48f23054bb Convert ext2fs_block_alloc_stats() calls to block_alloc_stats2()
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-25 21:46:58 -04:00
Valerie Aurora Henson d7cca6b06f Convert to use block group accessor functions
Convert direct accesses to use the following block group accessor
functions: ext2fs_block_bitmap_loc(), ext2fs_inode_bitmap_loc(),
ext2fs_inode_table_loc(), ext2fs_bg_itable_unused(),
ext2fs_block_bitmap_loc_set(), ext2fs_inode_bitmap_loc_set(),
ext2fs_inode_table_loc_set(), ext2fs_bg_free_inodes_count(),
ext2fs_ext2fs_bg_used_dirs_count(), ext2fs_bg_free_inodes_count_set(),
ext2fs_bg_free_blocks_count_set(), ext2fs_bg_used_dirs_count_set()

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-25 21:43:47 -04:00
Theodore Ts'o cd65a24e75 libext2fs: Convert ext2fs_bg_flag_test() to ext2fs_bg_flags_test()
After cleaning up ext2fs_bg_flag_set() and ext2fs_bg_flag_clear(),
we're left with ext2fs_bg_flag_test().  Convert it to
ext2fs_bg_flags_test().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-25 21:42:12 -04:00
Eric Sandeen e633b58ac7 libext2fs: clean up ext2fs_bg_flags_ interfaces
The ext2fs_bg_flag* functions were confusing.

Currently we have this:

void ext2fs_bg_flags_set(ext2_filsys fs, dgrp_t group, __u16 bg_flags);
void ext2fs_bg_flags_clear(ext2_filsys fs, dgrp_t group,__u16 bg_flags);

(_set (unused) sets exactly bg_flags; _clear clears all and ignores bg_flags)

and these, which can twiddle individual bits in bg_flags:

void ext2fs_bg_flag_set(ext2_filsys fs, dgrp_t group, __u16 bg_flag);
void ext2fs_bg_flag_clear(ext2_filsys fs, dgrp_t group, __u16 bg_flag);

A better interface, after the patch below, is just:

ext2fs_bg_flags_zap(fs, group) /* zeros bg_flags */
ext2fs_bg_flags_set(fs, group, flags) /* adds flags to bg_flags */
ext2fs_bg_flags_clear(fs, group, flags) /* clears flags in bg_flags */

and remove the original ext2fs_bg_flags_set / ext2fs_bg_flags_clear.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-25 21:41:32 -04:00
Theodore Ts'o 95bcea9fc1 Merge branch 'maint' into next
Conflicts:
	configure
	configure.in
	misc/mke2fs.c
2009-10-04 20:40:46 -04:00
Theodore Ts'o e1f0850795 Don't use in-tree header files if using system uuid or blkid libraries
This commit forces the use of the system-provided blkid or uuid header
files if we are using the system-provided blkid or uuid libraries.
This avoids using the in-tree header files with the system libraries.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-04 14:45:08 -04:00
Valerie Aurora Henson 4efbac6fed Convert uses of super->s_*_blocks_count to ext2fs_*_blocks_count()
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07 20:46:34 -04:00
Valerie Aurora Henson a63745e81c Use ext2fs_file_acl_block() instead of using .i_file_acl directly
This provides support for 48-bit file acl blocks.

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07 22:29:45 -04:00
Peng Tao 2884d208a3 resize2fs: fix minimum resize size calculation with flex_bg
When flex_bg is on, calculate_minimum_resize_size() should add more meta
blocks for newly added flex_bg.

Addresses-RedHat-Bugzilla: #519131
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-09-07 16:21:19 -04:00
Peng Tao 1d8af189bd resize2fs: calculate minimal fs size only once
When running resize2fs -M, no need to recalculate the minimal fs size.

Signed-off-by: "Peng Tao" <bergwolf@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-09-07 14:20:52 -04:00
Theodore Ts'o 732c8cd58f Use accessor functions fields for bg_flags in the block group descriptors
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07 21:15:12 -04:00
Valerie Aurora Henson 24a117abd0 Convert to use io_channel_read_blk64() and io_channel_write_blk64()
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07 21:14:24 -04:00
Theodore Ts'o dc615a21c3 Merge branch 'maint' into next 2009-09-07 17:02:35 -04:00
Valerie Aurora Henson 3346084bea resize2fs: Move everything to new bitmap interface
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22 21:13:37 -04:00
Theodore Ts'o 96cdb37e27 resize2fs: If resize2fs fails, tell the user to run e2fsck
If the resize operation fails in the middle of the operation, mark the
filesystem as needing to be checked, and tell the user that they
should run e2fsck -fy on the device.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-11 14:16:39 -04:00
Theodore Ts'o 3a4d9869d4 resize2fs: Fix error message so the mountpoint is printed correctly
The resize2fs program was freeing the mountpoint information too
early, so garbage was getting printed instead of the correct
information in an error message.

Addresses-Debian-Bug: #535452

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-02 13:54:22 -04:00
Theodore Ts'o c13351f6c5 Add support for configure --enable-verbose-makecmds
Some people don't want to see the concise "kernel-style" make output.
This configure option allows build engines that want to see the full
set of commands executed by the makefile to get what they want.  Most
people will find this more distracting than useful, unless they need
to debug the Makefiles.

(It is not necessary to rerun configure to enable this verbose make
output temprarily; if a developer wants to do a quick debug of a
directory's makefile, he or she can simply edit the definition of the
$(E) and $(Q) variables in the Makefile; instructions can be found in
the MCONFIG file which is included in at the beginning of every
Makefile.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-02 00:11:17 -04:00
Theodore Ts'o a6a1c0815c Fix Makefile dependencies for libcom_err
The e2fsprogs makefiles were using the same Makefile variable
LIBCOM_ERR for the link-line arguments as well as the dependencies.
Since LIBCOM_ERR can now include non-file arguments such as
"-lpthread", we need to use a separate DEPLIBCOM_ERR variable that
only has build file dependencies.

Do the same thing for STATIC_LIBCOM_ERR and PROFILED_LIBCOM_ERR.

Addresses-Sourceforge-Patches: #2813809

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-01 22:06:51 -04:00
Eric Sandeen 8a6ede8b7a resize2fs: update sb journal backup if journal was moved
This was reported in Fedora, since the livecd creator does
a lot of resizing.

If we've moved the journal blocks during resize (more likely now,
due to the journal being in the middle) the backup blocks in the
superblock don't get updated, and a subsequent e2fsck will find
issues:

e2fsck 1.41.6 (30-May-2009)
Backing up journal inode block information.

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/mnt/test/img: ***** FILE SYSTEM WAS MODIFIED *****
/mnt/test/img: 11/16000 files (0.0% non-contiguous), 17789/38400 blocks

This can be shown in a simple test:

# dd if=/dev/zero of=img bs=1 count=0 seek=3000M
# mke2fs -t ext4 -F img
# resize2fs img 150M
# e2fsck -f img

(thanks to the Fedora reporter Mads Kiilerich for the testcase!
https://bugzilla.redhat.com/show_bug.cgi?id=506105#c2)

So, update the backup journal in the superblock before resize2fs exits.

Addresses-RedHat-Bugzilla: #505339

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-18 07:47:54 -04:00
Theodore Ts'o e2ca097fc6 resize2fs: fix miscellaneous memory leaks
Fix various memory leaks which were discovered using valgrind.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-15 03:54:31 -04:00
Theodore Ts'o 4f858546e1 Update man pages to include ext4 in the synposis, instead of just "ext2/ext3"
The e2fsprogs programs have historically just said that they operate
on ext2 and ext3 file system in their man pages.  Update them to say
that they also operate on ext4 file systems.

Addresses-Launchpad-bug: #381854

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-05-30 12:34:28 -04:00
Eric Sandeen 0d04d88a8d resize2fs: don't try to resize below calculated minimum
Without a force flag, don't allow resize2fs to even start resizing
below what it thinks the minimum safe value is.

This may stop resizes which could otherwise proceed with a bit
of space still left, but seems like a reasonably safe thing to do.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-05-25 22:40:49 -04:00
Eric Sandeen 69f7c80eaf resize2fs: fix minimum size calculations
The extra padding added to the minimum size calculations:

        /*
         * We need to reserve a few extra blocks if extents are
         * enabled, in case we need to grow the extent tree.  The more
         * we shrink the file system, the more space we need.
         */
        if (fs->super->s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)
                blks_needed += (fs->super->s_blocks_count - blks_needed)/500;

can go quite wrong if we've already added up more "blks_needed"
than our current size, and the above subtraction wraps.  This can
easily happen for a filesystem which is almost completely full.

In this case, just return the current fs size as the minimum and
be done with it.

With this fix we could probably call calculate_minimum_resize_size()
for each resize2fs invocation and refuse to resize smaller than that?

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-05-25 22:40:35 -04:00
Theodore Ts'o fb72556af8 resize2fs: Print a warning message if the ftruncate system call fails
Resize2fs will attempt to truncate an image file of a filesystem down
to size for the convenience of the system administrator.  If the
truncate operation fails, print a warning message.  This also avoids a
gcc warning message.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-22 15:10:36 -04:00
Theodore Ts'o 2d7361ebfa resize2fs: Fix corruption bug impacting ext4 filesystems with uninit_bg
Due to a fencepost bug, when skipping a block group whose block bitmap
was uninitialized (and hence could not contain any blocks eligible for
relaocation), the block immediately following the block group wasn't
checked as well.  If it was in use and required relocation, it
wouldn't get properly relocated, with the result that an inode using
such a block would end up, post resize, with a pointer to a block now
outside the bounds of the filesystem.

This commit fixes this fencepost error.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-18 22:42:13 -04:00
Theodore Ts'o c09043f1ab resize2fs: Fix data corruption bug when shrinking the inode table for ext4
If we need to shrink the inode table, we need to make sure the inodes
contained in the part of the inode table we are vacating don't get
reused as part of the filesystem shrink operation.  This wasn't a
problem with ext3 filesystems, since the inode table was located in
the block group that was going away, so that location was not eligible
for reallocation.

However with ext4 filesystems with flex_bg enabled, it's possible for
a portion of the inode table in the last flex_bg group to be
deallocated, but in a part of the filesystem which could be used as
data blocks.  So we must mark those blocks as reserved to prevent
their reuse, and adjust the minimum filesystem size calculation to
assure that we don't shrink a filesystem too small for the resize
operation to succeed.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-18 22:32:03 -04:00
Theodore Ts'o 1ac84a948d resize2fs: Fix data corruption bug when growing an ext4 filesystem off-line
When allocating a new set of block group metadata as part of growing
the filesystem, the resize2fs code assumes that the bitmap and inode
table blocks are in their own block group; an assumption which is
changed by the flex_bg feature.  This commit works around the problem
by temporarily turning off flex_bg while allocating the new block
group metadata, to avoid potentially overwriting previously allocated
data blocks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-18 13:31:54 -04:00
Jim Meyering 45e338f533 remove useless if-before-free tests
In case you're wondering about whether this change is safe from a
portability standpoint, fear not.  This has been beaten to death
in other forums.  Here are a few threads:

  http://thread.gmane.org/gmane.comp.version-control.git/74187
  http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/12712
  http://thread.gmane.org/gmane.emacs.devel/98144
  http://thread.gmane.org/gmane.comp.lib.glibc.alpha/13092

There has been debate about whether it's a good idea from a
performance standpoint, too, but imho you'll have a hard time
finding an instance where this sort of change induces a
measurable performance penalty.  If you do, please let me know.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-08 20:37:12 -04:00
Theodore Ts'o 793a04a071 resize2fs: Reserve some extra space for -P/-M for ext4 filesystems
Some extra blocks may be needed to expand some extent allocation trees
while we are shrinking the filesystem.  We don't know exactly how
much, so we use a hueristic.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 00:46:06 -05:00
Theodore Ts'o 9227c5bbbd resize2fs: Release bitmap and itable blocks in flex_bg filesystems
Previously resize2fs assumed that bitmap and inode table blocks were
always located in their respective block group.  However, this is no
longer true with flex_bg.  So it is necessary to check all of the
block groups which will be truncated to see if they have metadata
blocks that need to be marked as no longer being in use in the new,
shrunk filesystem.

This bug fixes resize2fs -M, which would otherwise fail because
without the released blocks, there would not be enough space in the
filesystem.  This bug also avoids (mostly harmless) filesystem
corruptions reported by e2fsck regarding blocks marked in use but not
actually used (these being the bitmap and inode table blocks
associated with the truncated block groups).

Note: in theory it is possible to have block group N utilize bitmap
and inode table blocks in block group N+X with flex_bg.  At the moment
neither mke2fs nor e2fsck will create filesystems like this, which is
good, because resize2fs doesn't handle this case correctly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-19 09:02:55 -05:00
Theodore Ts'o c58a08e673 resize2fs: Move all required blocks for ext4 filesystems
In the function blocks_to_move(), when checking to see if a block
group's block bitmap is initialized, we need to check the old_fs's
block group descriptors, not the new file system's (already truncated)
group descriptor data structures.  Otherwise we will end up
derferencing past the end of the array boundary, and the resulting
garbage value may indicate that the bitmap is uninitialized, and so
all of the blocks in that block group will be skipped, resulting in
some blocks not getting marked as needing relocation.

This showed up in the following test case:

     mke2fs -t ext4 -b 1024 test.img 1048576
     resize2fs test.img 80000

The journal inode after the resize operation looked like this:

debugfs:  stat <8>
Inode: 8   Type: regular    Mode:  0600   Flags: 0x80000
...
BLOCKS:
(IND):35385, (0-5836):2356-8192, (5837-21959):8454-24576, (21960-32506):24838-35
384, (32507-32767):434177-434437
TOTAL: 32769

The blocks 434177-434437 were not moved because block group 53 was
wrongly thought to have an unitialized block group.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-19 08:43:36 -05:00
Theodore Ts'o 03fa6f8ae2 Fix various signed/unsigned gcc warnings
Some of these could affect filesystems between 2^31 and 2^32-1 blocks.

Thanks to Valerie Aurora Henson for pointing out the problems in
lib/ext2fs/alloc_tables.c, which led me to do a "make gcc-wall" scan
over the source tree.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-16 10:06:59 -05:00
Eric Sandeen 279a000fdc resize2fs: check for bogus new_size
If we don't check for new_size == 0, bogus values send resize2fs into
a tailspin:

resize2fs 1.41.0 (10-Jul-2008)
Illegal block number passed to ext2fs_test_block_bitmap #1 for block bitmap for
/tmp/tmp.lntZtMFvz8/fake-disk
...the same message repeated zillion times...

Probably should see where that loop is, but at any rate we should
error-check parse_num_blocks.

Thanks to Petr Muller for reporting this.

Addresses-Red-Hat-Bugzilla: #465984

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-10-12 23:12:22 -04:00
Manish Katiyar 520a177292 resize2fs: Fix potential memory corruption in ext2fs_progress_init()
Check the return value of ext2fs_get_mem, since prog isn't initialized
so checking may miss a failed memory allocation.

Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-01 19:42:57 -04:00
Theodore Ts'o f34171a7ff Fix debug flag definitions for the resize2fs man page
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-01 11:36:59 -04:00
Theodore Ts'o f38cf3cb34 Only use the test_io manager if the right environment variables are set
In order to make it possible for the test_io manager to be compiled in
by default, make all of the programs that might try to use it to only
do so if the environment variables TEST_IO_FLAGS and TEST_IO_DEBUG are
set.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-01 11:36:53 -04:00
Theodore Ts'o f844b32a09 resize2fs: Allow (non-optimal) on-line resizing for flex_bg filesystems
The current method of adding one block group at a time to a mounted
filesystem means it is impossible to accomodate the flex_bg allocation
method of placing the metadata together in a single block group.  For
now we "fix" this issue by using the traditional layout for new block
groups, where each block group is self-contained and contains its own
bitmap blocks and inode tables.  This means we don't get the layout
advantages of flex_bg in the new block groups, but at least it allows
on-line resizing to function.

Long term, we will need to create a new ioctl which does much more of
the resizing work in the kernel.

We also fix a bug in the ext3/ext4 ioctl fallback code so we stop
trying the ext3 ioctl for every single block group when resizing an
ext4 filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-28 16:40:38 -04:00
Theodore Ts'o efc6f628e1 Remove trailing whitespace for the entire source tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27 23:07:54 -04:00
Theodore Ts'o 88dbf8287f resize2fs: Make sure we close out the progress bar in pass #4
This fixes a cosemtic issue where we don't complete the progress bar
and issue a newline before printing the final resize successful
message.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-22 09:57:44 -04:00
Theodore Ts'o 7f9c96ee74 resize2fs: supply block allocator for extents function
In the rare case where new blocks are needed while mutating an extent
tree, supply a specialized block allocator so that extent_node_split()
allocates valid blocks for the interior nodes of the extent tree.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-22 03:07:53 -04:00
Theodore Ts'o 86acdebd53 resize2fs: Fix support for filesystems with the uninit_bg feature
If the filesystem has the uninit_bg feature, then parts of the block
and inode bitmap may not be initialized.  Teach resize2fs how to deal
with these case appropriately.  (Most of these fixes were fortunately
not necessary for the common case where the resize_inode is present to
reserve space, and where the filesystem is being expanded instead of
being shrunk.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-22 03:03:42 -04:00
Theodore Ts'o c89f1b4ca5 resize2fs: Fix double bumping of directory in-use counts
When moving directories into new block groups (which would only happen
when shrinking a filesystem), resize2fs would increase the directory
in-use count by 2 times the necessary value, due to a change in
ext2fs_inode_alloc_stats() made in e2fsprogs 1.26.  This is largely
harmless, but it does result in a filesystem corruption for e2fsck to
fix.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-17 23:20:16 -04:00
Theodore Ts'o df9c01b144 Fix missing space typo's in partinfo and resize2fs
These were caused by multi-line strings missing a space at the line
break.  Thanks to translator Phillipp Thomas for noticing these typo's.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-17 10:50:26 -04:00
Theodore Ts'o 8ade268cf2 resize2fs: Clean up the resize inode properly if necessary
If the filesystem is grown to the point where the resize_inode is no
longer needed, clean it up properly so e2fsck doesn't have to.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-10 14:18:41 -04:00
Theodore Ts'o 71ff129e9f Merge branch 'maint'
Conflicts:

	README
	resize/online.c
	version.h
2008-06-17 23:54:51 -04:00
Theodore Ts'o 9ff8ece57d mke2fs, tune2fs, resize2fs: Use floating point to calculate percentages
When calculating the number reserved blocks, use floating point for
better accuracy, since for big filesystems it really makes a
difference.  In addition, mke2fs and tune2fs accepts a floating point
number from the user, so they should provide that level of accuracy.

Addresses-Debian-Bug: #452639

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-17 21:08:49 -04:00
Theodore Ts'o a8d632a4e9 resize2fs: Prohibit the combination of flex_bg and !resize_inode
This is a potentially a difficult case for resize2fs to handle, so
prohibit it for now.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-17 01:53:53 -04:00
Theodore Ts'o 74128f8d7e resize2fs: Fix support for the uninit_bg feature
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-17 01:14:30 -04:00
Theodore Ts'o 5c4f8d6748 resize2fs: Add support to use the ext4 online resize ioctl's
First try the ext3 ioctl, but if we get an error, try using the ext4
ioctl.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 13:13:16 -04:00
Theodore Ts'o 2c25f7e75a Fix gcc -Wall warnings in resize2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 11:52:33 -04:00
Theodore Ts'o 2930dad2b2 Rename the feature uninit_groups to uninit_bg
Allow the old name of uninit_groups when converting feature names for
backwards compatibility for scripts running mke2fs and tune2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 23:31:44 -04:00
Theodore Ts'o 1ca1059fd0 Add support for the HUGE_FILE feature
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 16:38:13 -04:00
Jose R. Santos 236efede19 Make resize2fs uninit block group aware
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20 15:33:12 -04:00
Josef Bacik 199ddaaa44 resize2fs: Add options to print (and resizing to) the minimum filesystem size
Add the -P option to print the minimum filesystem size and exit.

Add the -M option to force resizing the filesystem to the minimum
filesystem size.

Signed-off-by: Josef Back <jbacik@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-15 01:30:43 -04:00
Theodore Ts'o a040a99b6c Merge branch 'maint'
Conflicts:

	lib/ext2fs/ext2_err.et.in
2008-03-13 10:53:26 -04:00
Theodore Ts'o edfd9b0a9f resize2fs: Fix resizing filesystems with large inodes
Use ext2fs_get_next_inode_full() in resize2fs and clean up large inode
handling; previous attempt was not properly handling all cases, and
was incorrectly setting i_extra_isize.  This caused some extended
attributes to get removed or randomly assigned to other inodes as a
result of the resize, which can be unfortunate on systems using
SELinux.

The previous commit didn't fix things completely on big-endian systems
like PowerPC.

Addresses-Red-Hat-Bugzilla: #434893

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-09 08:00:12 -04:00
Theodore Ts'o 399033a6ab Merge branch 'maint' 2008-02-29 00:43:29 -05:00
Eric Sandeen 4ef28824ca resize2fs: Fix movement of large (greater than 128 byte) inodes
inode_scan_and_fix() in resize2fs needs to do read/write of the full
inode to be sure it gets all data from larger (>128 byte) inodes.

Addresses-Red-Hat-Bugzilla: #434893

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-28 18:05:41 -05:00
Theodore Ts'o 428f6b32a9 Merge branch 'maint' into next
Conflicts:

	configure
	lib/ext2fs/ext2_fs.h
	misc/e2image.c
2008-01-27 20:09:05 -05:00
Theodore Ts'o 3e9f86326d Fix minor typo in resize2fs man page
Taken from SLES patch: e2fsprogs-1.39-resize2fs_manpage.patch

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-27 00:08:49 -05:00
Theodore Ts'o 261cd3964f Explicitly check for ftruncate64() in configure.in
Apparently Mac OS 10.5 defines fstat64(), but not ftruncate64(),
causing resize2fs to fail to build.  So check explicitly for
ftruncate64(), and fall back to ftruncate() if necessary.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-21 13:45:00 -05:00
Theodore Ts'o 98dca6c552 resize2fs: Add sanity check for off_t overflow before truncating
If we can't use ftruncate64(), and have to use ftruncate() instead,
make sure that we don't accidentally truncate the size when we chop it
down to an off_t before calling ftruncate(), lest we severely damage a
filesystem image file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-21 13:43:18 -05:00
Theodore Ts'o fef2b38d8e Merge branch 'maint' into next
Conflicts:

	configure
	debian/rules
	e2fsck/swapfs.c
	lib/ext2fs/ext2_fs.h
2008-01-01 12:41:35 -05:00
Theodore Ts'o e5aace908e Convert use of ext2fs_get_mem to ext2fs_get_array for overflow detection
Add some additional checks, primarily in resize2fs and in the rarely
used (and soon to-be-deprecated) e2fsck byte-swap filesystem function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-27 10:08:13 -05:00
Theodore Ts'o b689b8dd14 Merge branch 'maint' into next
Conflicts:

	lib/ext2fs/closefs.c
2007-12-17 10:28:01 -05:00
Samuel Thibault 3e41608aac Fix Debian rules files to support building non-Linux archs
Addresses-Debian-Bug: #437720

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-15 20:59:29 -05:00
Valerie Clement f2de1d38d0 libext2fs: Add EXT2_DESC_SIZE and EXT2_DESC_PER_BLOCK macros
Add macros to support variable-length group descriptors for ext4.

Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-10-14 22:08:35 -04:00
Theodore Ts'o 424a3e4a23 Remove Changelog files since they're not used after the git migration
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 08:50:41 -04:00
Theodore Ts'o d7b64725ee Update Release Notes, Changelogs, version.h, etc. for 1.40 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-24 17:32:47 -04:00
Theodore Ts'o 058ad1c70c Don't write changes to the backup superblocks by default
This patch changes ext2fs_open() to set EXT2_FLAG_MASTER_SB_ONLY by
default.  This avoids some problems in e2fsck (reported by Jim Garlick)
where a corrupt journal can end up writing the bad superblock to the
backups.  In general, only e2fsck (after the filesystem is clean),
tune2fs, and resize2fs should change the backup superblocks by default.
Most callers of ext2fs_open() should not be touching anything where the
backups should be touched.  So let's change the defaults to avoid
potential problems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-18 18:26:50 -04:00
Andreas Dilger de8f3a7621 Fix gcc -Wall warnings, especially on 64-bit systems
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-25 11:18:11 -04:00
Theodore Ts'o 96c6a3acd3 Store the RAID stride value in the superblock and take advantage of it
Store the RAID stride value when a filesystem is created with a requested
RAID stride, and then use it automatically in resize2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-18 22:06:53 -04:00
Brian Behlendorf d2b2a488f9 [COVERITY] Fix missing return code check for ext2fs_write_inode
Found 2 of the three places where a return code for ext2fs_write_inode() was
not being checked.

The second fix in e2fsck/emptydir.c is basically just to shut coverity up even
though it really is unnecessary.

Coverity ID: 1: Checked Return

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-03-18 11:16:33 -04:00
Theodore Ts'o a6d8302b48 Use the newer add/remove_error_table com_err interfaces
Change all of the e2fsprogs programs to use the newer add_error_table()
and remove_error_table() interfaces instead of the much older
initialize_*_error_table() function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-12-26 03:38:07 -05:00
Theodore Ts'o d255b22ef0 Fix resize2fs error msgs if the fs or kernel doesn't support on-line resize
Check to make sure the filesystem has a resize inode if it is needed to
grow the filesystem.  Print the correct error message if the kernel
returns an ENOTTY error to the group extend ioctl

Addresses Debian Bug: #380548

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-10-02 08:30:34 -04:00
Eric Sandeen d1b4b85c3a Fix more rounding overflows for filesystems that have 2**32-1 blocks
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-09-12 14:56:18 -04:00
Eric Sandeen f335864338 Add checks to make sure inode counts don't overflow a 32-bit value
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-09-12 14:56:17 -04:00
Eric Sandeen d0ff90d520 Fix signed vs unsigned printf format strings for block and inode numbers
There were still some %d's lurking when we print blocks & inodes; also
many of the counters in the e2fsck_struct were signed, and probably
need to be unsigned to avoid overflows.

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-09-12 14:56:15 -04:00
Eric Sandeen 62c6d1403e Remove unused variables
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-09-12 14:56:12 -04:00
Theodore Ts'o a8862d9e90 Fix potential 2**32-1 overflow by using e2p_percent()
Add a new functiom, e2p_percent(), which correct calculates the percentage
of a number based on a given percentage, without worrying about overflow
issues.  This is used where we calculate the number of reserved blocks using
a percentage of the total number of blocks in a filesystem.

Based on patches from Eric Sandeen, but generalized to use this new function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-08-30 03:08:13 -04:00
Eric Sandeen 5830d6be9c Detect overflows in loop counters
For loops such as:

for (i=1; i <= fs->super->s_blocks_count; i++) {
        <do_stuff>
}

if i is an int and s_blocks_count is (2^32-1), the condition is never false.
Change these loops to:

for (i=1; i <= fs->super->s_blocks_count && i > 0; i++) {
        <do_stuff>
}

to stop the loop when we overflow i

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-08-30 02:16:55 -04:00
Theodore Ts'o 69022e029f Fix potential 2**32-1 overflow problems by ext2fs_div_ceil()
Add a new function, ext2fs_div_ceil(), which correctly calculates a division
of two unsigned integer where the result is always rounded up the next
largest integer.   This is used everywhere where we might have
previously caused an overflow when the number of blocks
or inodes is too close to 2**32-1.

Based on patches from Eric Sandeen, but generalized to use this new function

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-08-30 01:57:00 -04:00
Theodore Ts'o 9447f38a17 Fix spelling mistakes in e2fsck, mke2fs.conf, and resize2fs man pages
Addresses Debian Bugs: #368392, #368393, #368394

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-05-22 17:59:37 -04:00
Theodore Ts'o 41e55437fd Clarify resize2fs man page and add reference to LVM
Addresses Debian Bug: #368179

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-05-21 19:33:46 -04:00
Theodore Ts'o 46c5490d13 Add RAID stride support to resize2fs
Resize2fs will now automatically determine the RAID stride parameter that
had been used to create the filesystem, and use that for newly created
block groups.   The RAID stride parameter may also be manually specified
on the command line using the new -S option to resize2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-05-14 15:33:57 -04:00
Takashi Sato 8deb80a5d1 Fix format statements to make e2fsprogs programs 32-bit clean
Change the format string(%d, %ld) for a block number and inode number
to %u or %lu.

Signed-off-by: Takashi Sato <sho@tnes.nec.co.jp>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-18 21:43:46 -05:00
Theodore Ts'o 5d2ef12f6e Change resize2fs open modes for mounted and unmounted filesystems
If the filesystem is mounted, open it in read-only mode since the userspace 
program should not try to modify it directly.  If the filesystem is not mounted,
open it in exclusive mode to avoid potential problems (such as someone 
trying to mount the filesystem while it is being resized).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-18 20:03:47 -05:00
Theodore Ts'o bf69235ad0 Add support for on-line resizing to resize2fs
If the filesystem is mounted, attempt to use the on-line resizing
ioctls to resize the filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-17 19:45:45 -05:00
Theodore Ts'o 68963d5a26 Clean up gcc -Wall complaints in resize2fs
Remove unused variables in mark_table_blocks()

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-12-29 15:44:45 -05:00
Theodore Ts'o fe07357f59 Make resize2fs expand or truncate a file containing a filesystem.
(Addresses Debian Bug: #271607)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-12-29 15:39:40 -05:00
Theodore Ts'o 2787276ec5 Fix fencepost error in resize2fs caught by valgrind
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>
2005-08-08 18:57:04 -05:00
Theodore Ts'o 1f965c8d96 Update for e2fsprogs 1.38 release. 2005-06-30 20:06:45 -04:00
Theodore Ts'o f35fd3d5ee Fix some minor typo's and grammar's strings, and remove debugging strings
from needing to be translated.  Patch is from Benno Schulenberg.
2005-05-09 16:22:17 -04:00
Theodore Ts'o 75e93ab097 Update "make depend" information. Fixes SMP parallel build problem.
(Addresses Sourceforge Bug: #1157933)
2005-05-06 09:37:58 -04:00
Theodore Ts'o fd4b28efd3 Update for the e2fsprogs 1.37 release. 2005-03-21 22:37:03 -05:00
Theodore Ts'o 3eee5e9eed Update for release of e2fsprogs 1.36. 2005-02-05 18:26:03 -05:00
Theodore Ts'o 64ad98acbe resize2fs.c: Fix bug where we don't release the blocks belonging
to the old inode table blocks when we move the inode
	table.  (Addresses Debian Bug: #290894)
2005-01-26 10:03:56 -05:00
Theodore Ts'o 55f4cbd96e Add new function in e2p for parsing the number of blocks on the command line
for mke2fs and resize2fs, and use this function so that filesystem size
inputs to e2fsprogs command line programs are parsed consistently.
2005-01-05 03:01:06 -05:00
Theodore Ts'o 9213a93b22 Fix resize2fs so that it properly handles filesystems with the resize_inode
feature enabled.
2004-12-24 01:34:29 -05:00
Theodore Ts'o 522798d342 Add install-strip and install-shlibs-strip targets
Use Linux-kernel-style makefile output for "make install"

Update intl/Makefile.in to version from gettext 0.14.1
2004-12-15 11:28:55 -05:00
Theodore Ts'o 6d4022786d Use MKINSTALLDIRS macro so that the Makefiles can find the script
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.
2004-12-14 21:46:26 -05:00
Theodore Ts'o 2e8ca9a26b Add support for passing options to the io layer using the URL syntax. For
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.
2004-11-30 14:07:11 -05:00
Theodore Ts'o 47204ff983 Use Linux-kernel-style makefile output to make it easier to
see errors/warnings.
2004-11-30 10:52:27 -05:00
Theodore Ts'o 06191693d4 resize2fs.c (check_and_change_inodes): Fix debugging printf to
mask off the high 256 bits of dirent->name_len (which is
	where the file type information is stored).  (Addresses
	Debian Bug #271605)
2004-09-17 17:10:17 -04:00
Theodore Ts'o aa5c0a4562 Remove .cvsignore files; they were out of date, and causes lintian
to flame about their presence in the source tarball.
2004-05-05 09:02:36 -04:00
Theodore Ts'o dd60705665 Refine the build process to avoid re-running subst all the time on
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.
2004-04-03 13:53:46 -05:00
Theodore Ts'o b70b1167fe Update version number for e2fsprogs 1.35 release. 2004-02-28 10:52:35 -05:00
Matthias Andree b969b1b8a5 Fix more compiler warnings. 2003-12-28 13:04:35 +01:00
Theodore Ts'o 544349270e Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
Theodore Ts'o a7ac1df34f Adjust description line so that apropos "ext2" or "ext3" will
find all of the e2fsprogs man pages.  (Addresses Debian Bug #206845)
2003-08-24 17:56:41 -04:00
Theodore Ts'o c4e3d3f374 ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem()
all now take a 'void *' instead of a 'void **' in order to 
avoid pointer aliasing problems with GCC 3.x.
2003-08-01 09:41:07 -04:00
Theodore Ts'o 9c7ec17809 Update for 1.34 release. 2003-07-26 01:03:34 -04:00
Theodore Ts'o a7ccdff8e1 In mke2fs and resize2fs, round the default size of the filesystem to
be an even multiple of the pagesize to work around a potential
Linux kernel bug.

Use the testio manager in mke2fs if CONFIG_TESTIO_DEBUG is set.
2003-07-08 18:03:48 -04:00
Theodore Ts'o 7d7bdd578b Fix bug in resize2fs which caused it to fail on filesystems with a
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.)
2003-06-24 17:34:02 -04:00
Theodore Ts'o 23658ffa30 resize2fs.8.in: Make explicit that you need to run resize2fs
after using fdisk to adjust the partition size when
	expanding the filesystem.  (Addresses Debian Bug #195616)
2003-06-08 20:32:46 -04:00
Theodore Ts'o 792a088162 main.c (main): Add the ability to specify units to the size
parameter, and make the error and information messages
	display explicitly the blocksize used by the filesystem,
	to avoid confusion.  (Addresses Debian bug: #189814)
2003-05-13 23:32:59 -04:00
Theodore Ts'o ddc32a045b Add Czech translation.
Remove "NYC" translation.  Add Czech translation from Miloslav 
Trmac <mitr@volny.cz>

Random NLS and other display fixes from Miloslav.
2003-05-03 18:45:55 -04:00
Theodore Ts'o a04eba3f88 Update to gettext 0.11.5. We now enable NLS support by default.
Fixed up support for using the internal intl library.
2003-05-03 16:35:17 -04:00
Theodore Ts'o 71df0dc393 Update for 1.33 release.
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.
2003-04-21 16:17:09 -04:00
Theodore Ts'o afb6d709ba Use DYLD_LIBRAY_PATH so that "make check" works on
Darwin systems when building with shared libraries.
2003-04-21 16:12:34 -04:00
Theodore Ts'o 424cb7b62a Bug fix; we were incorrectly moving the block and inode bitmaps
for sparse superblock filesystems.  (Address Debian bug #174766)
2003-03-06 12:22:52 -05:00
Theodore Ts'o 38513011b9 Update files for 1.32 release. 2002-11-09 15:00:56 -05:00
Theodore Ts'o ae65b29f11 Update files for 1.31 release. 2002-11-08 20:08:48 -05:00
Theodore Ts'o 5d823a478f Update files for 1.30 release. 2002-11-01 02:13:53 -05:00
Theodore Ts'o 085d2a8397 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.
2002-10-31 19:56:56 -05:00
Theodore Ts'o 482afc442d Makefile.in (install): Search all compression extensions when
deleting old man pages.
2002-10-31 03:32:34 -05:00
Theodore Ts'o 76dd5e5c28 Add support for the meta_bg feature flag to the resize2fs program.
Fix bug in meta_bg support in mke2fs, e2fsck, and dumpe2fs; we were 
incorrectly reserving the legacy block groups desriptor blocks.
2002-10-30 23:07:21 -05:00
Theodore Ts'o 143ac30c02 resize2fs.8.in: Fix typo in man page. 2002-10-03 11:52:41 -04:00
Theodore Ts'o c663305947 Update for 1.29 release. 2002-09-24 01:26:50 -04:00
Theodore Ts'o 87ee8dcad3 Update changelogs for 1.28 release 2002-08-31 03:02:57 -04:00
Theodore Ts'o 0ccd488a76 Fix stupid typo in previous changeset. 2002-08-16 17:07:06 -04:00
Theodore Ts'o ed909bbe20 Fix up extended attribute handling in e2image, resize2fs, and in
debugfs's icheck command.
2002-08-16 17:03:59 -04:00
Theodore Ts'o cefbf4870c 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).
2002-07-26 01:56:22 -04:00
Theodore Ts'o 41cce580f3 main.c (main): If the filesystem has errors or is not valid,
then require an e2fsck -f run to be done on the filesystem
	more.
2002-05-28 23:19:14 -04:00
Theodore Ts'o 1608211222 main.c (main): If resize_fs returns an error, don't print the
message stating that the filesystem was resized after
	printing the error.
2002-04-09 12:46:19 -04:00
Theodore Ts'o 116db1b513 main.c (main): If we are resizing a plain file which is smaller
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.
2002-04-01 01:28:30 -05:00
Theodore Ts'o a8e772498c Update for 1.27 release. 2002-03-08 03:12:14 -05:00
Theodore Ts'o 546a1ff18c Fix various gcc -Wall complaints. 2002-03-07 23:52:56 -05:00
Theodore Ts'o 304905df4a Makefile.in (check): Use LD_LIBRARY_PATH to run test programs.
(From Philipp Thomas <pthomas@suse.de>)
2002-03-07 20:55:01 -05:00
Theodore Ts'o 57173d0feb Update Changelog messages to use tytso@mit.edu for all addresses
after September 7, 2001.  (Forgot to update my emacs file to get
rid of the tytso@valinux.com address.  Oops.)
2002-02-26 14:59:39 -05:00
Theodore Ts'o b9f409255e Update makefiles to install mkfs.ext3, and to install man pages for
mkfs.ext2/3 and fsck.ext2/3.  Also remove any compressed man pages
before installing the man pages.
2002-02-24 03:08:57 -05:00
Theodore Ts'o a5f3f5c191 Update files for 1.26 release. 2002-02-03 01:00:22 -05:00
Theodore Ts'o fbf9111216 Update changelogs for 1.25 release. 2001-09-20 10:47:47 -04:00
Theodore Ts'o fb70775b0f Update for 1.24a release 2001-09-04 15:00:37 -04:00
Theodore Ts'o 109624a133 Update for 1.24 release. 2001-08-31 00:59:55 -04:00
Theodore Ts'o 943ed874fc Add missing log entry showing when we released e2fsprogs 1.23 2001-08-27 12:29:22 -04:00
Theodore Ts'o 67960139d7 Update changelogs for 1.22. 2001-06-23 00:16:37 -04:00
Theodore Ts'o f4f75bae85 ChangeLog:
Update for 1.21 release.
2001-06-16 01:14:28 +00:00
Theodore Ts'o 36a23e1806 ChangeLog:
Fix typo in ChangeLog.
2001-06-02 00:54:10 +00:00
Theodore Ts'o 797f5ef14e ChangeLog, wordwrap.pl:
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.
2001-06-01 23:49:46 +00:00
Theodore Ts'o bb185861d1 e2fsprogs.lsm, version.h:
Update version string for 1.20 release
ChangeLog:
  Update Changelogs for 1.20 release.
2001-05-25 17:35:00 +00:00
Theodore Ts'o 54c637d4d2 Many files:
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
2001-05-14 11:45:38 +00:00
Theodore Ts'o a05c589a5e Makefile.in:
Update makefile dependencies
2001-01-18 02:37:21 +00:00
Theodore Ts'o 48e08e034e ChangeLog, main.c:
main.c (main): Use ext2fs_sync_device() instead of calling the
  	BLKFLSBUF ioctl directly.
2001-01-11 16:11:11 +00:00
Theodore Ts'o dfcdc32f8d ChangeLog, libext2fs.texinfo:
libext2fs.texinfo: Change ino_t to ext2_ino_t
ChangeLog, extent.c, main.c, resize2fs.c:
  extent.c, main.c, resize2fs.c: Change ino_t to ext2_ino_t.
ChangeLog, mke2fs.c:
  mke2fs.c: Change ino_t to ext2_ino_t.
ChangeLog, test_icount.c, test_rel.c:
  test_icount.c, test_rel.c: Change ino_t to ext2_ino_t
2001-01-11 15:38:00 +00:00
Theodore Ts'o e5b38a5faf Many files:
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.
2001-01-01 16:17:12 +00:00
Theodore Ts'o 0e8a9560d8 Many files:
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.
2000-12-09 06:41:25 +00:00
Theodore Ts'o 3e377db294 ChangeLog, MCONFIG.in, Makefile.in, Makefile.in.in:
Fix so that top-level "make check" works correctly.
e2image.c:
  Fix program name for e2image.
2000-12-09 02:37:33 +00:00
Theodore Ts'o f9e67064ce configure.in:
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.
2000-07-13 23:25:54 +00:00
Theodore Ts'o e4c8e885d2 ChangeLog, Makefile.in:
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.
2000-07-05 23:54:46 +00:00
Theodore Ts'o a13575f4d2 ChangeLog, extent.c, main.c, resize2fs.c, resize2fs.h:
main.c, resize2fs.c, resize2fs.h, extent.c: Add NLS support.
2000-06-12 22:06:16 +00:00
Theodore Ts'o bdcb8234e7 .cvsignore:
Supress build files when builddir==srcdir
2000-05-25 23:19:08 +00:00
Theodore Ts'o 0cee8a5c42 Many files:
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
2000-04-06 21:38:34 +00:00
Theodore Ts'o 373b8337c7 Many files:
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.
2000-04-03 16:22:35 +00:00
Theodore Ts'o 0a617317ee ChangeLog, main.c, resize2fs.h:
resize2fs.h: Remove unneeded #include of linux/fs.h
  main.c: Fix gcc -Wall bug.  main() should return an int.
2000-02-02 19:14:36 +00:00
Theodore Ts'o 5c36a2f85b ChangeLog, Makefile.in:
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.
1999-11-19 18:42:30 +00:00
Theodore Ts'o cd08636179 libext2fs.texinfo, ChangeLog:
Update for 1.18 release.
1999-11-10 16:00:39 +00:00
Theodore Ts'o 28e1194e65 Many files:
Update for 1.17 release.
1999-10-26 18:17:20 +00:00
Theodore Ts'o 614fdfd5d9 ChangeLog:
Update for 1.16 release.
libext2fs.texinfo:
  Update version number for 1.16 release.
1999-10-23 03:19:51 +00:00
Theodore Ts'o 657cb97522 ChangeLog:
Add 1.15 release note to the Changelogs.
1999-07-30 23:19:10 +00:00
Theodore Ts'o 790a0ad4d5 Makefile.in:
Add resize2fs.clean to the clean list.
1999-07-19 16:16:12 +00:00
Theodore Ts'o 45a676b5f1 Makefile.in:
Update dependencies.
ChangeLog:
  Update ChangeLog to reflect full set of changes to configure.in
1999-07-03 20:45:28 +00:00
Theodore Ts'o 9e51eca782 ChangeLog, message.c:
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.
1999-01-09 16:32:31 +00:00
Theodore Ts'o 556ad1327f Many files:
Update version information in ChangeLogs, release notes,
  documentation, etc.  for release of version 1.13.
1998-12-19 08:10:58 +00:00
Theodore Ts'o dba838b09e ChangeLog, Makefile.in:
Makefile.in: Updated dependencies.
1998-12-04 06:15:12 +00:00
Theodore Ts'o 7e71e4c545 .del-resize2fs.spec~524d144b:
Fix up version number for 1.03
ChangeLog, main.c:
  Print a feedback message stating the new size of the filesystem when
  we're through.
1998-09-30 00:54:35 +00:00
Theodore Ts'o 612ff39bfd main.c:
Remove timebomb for production version.
resize2fs.8.in, .del-version.h~524d144b:
  Update for production version of resize2fs.
1998-09-29 04:00:55 +00:00
Theodore Ts'o 1333fe9344 ChangeLog, resize2fs.c:
resize2fs.c: Rename max to max_groups and max_dirs to avoid possible
  	conflicts with a cpp macro named "max".
1998-09-03 00:26:49 +00:00
Theodore Ts'o 169cb54646 ChangeLog, mk_cmds.sh.in:
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.
1998-08-01 04:33:31 +00:00
Theodore Ts'o 4a5fa19212 ChangeLog, .del-ChangeLog~905e7699, version.h:
Update for 1.12 release.
1998-07-09 05:42:45 +00:00
Theodore Ts'o 084307590c ChangeLog, resize2fs.c:
Change blkcnt_t to be e2_blkcnt_t to avoid collision with the LFS API.
1998-06-10 20:36:37 +00:00
Theodore Ts'o 4c77fe50d9 ChangeLog, e2fsck.h, pass1.c, super.c:
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.
1998-04-30 17:35:59 +00:00
Theodore Ts'o 76f875daa1 Many files:
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().
1998-04-27 01:41:13 +00:00
Theodore Ts'o d9e70c949a .del-resize2fs.spec~524d144b:
Change to be version 1.02.
1998-04-08 07:04:48 +00:00
Theodore Ts'o 2e561e0249 main.c, .del-version.h~524d144b:
Add expire time checking to the resize2fs driver program.
  Change the version number to be version 1.02.
1998-04-08 06:18:37 +00:00
Theodore Ts'o d171c5b5ee ChangeLog, subst.conf.in:
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.
1998-04-03 16:07:06 +00:00
Theodore Ts'o 2a3013b807 ChangeLog, test_icount.c, test_icount.h:
test_icount.h (do_dump, do_validate): Add prototypes to fix -Wall
  	warnings.
  test_icount.c: Fix -Wall warnings.
ChangeLog, extent.c, main.c:
  extent.c (extent_cmp): Add const to cast to prevent -Wall warning.
  main.c (check_mount): Rename function argument to prevent -Wall
  	warning.
1998-03-30 01:08:41 +00:00