Commit Graph

124 Commits (714da4515e716a35edf602d0ea8dcd072ad9e0d8)

Author SHA1 Message Date
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 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 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
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