Whamcloud - gitweb
tools/e2fsprogs.git
14 years agoConvert to use block group accessor functions
Valerie Aurora Henson [Mon, 26 Oct 2009 01:43:47 +0000 (21:43 -0400)]
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>
14 years agolibext2fs: Convert ext2fs_bg_flag_test() to ext2fs_bg_flags_test()
Theodore Ts'o [Mon, 26 Oct 2009 01:42:12 +0000 (21:42 -0400)]
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>
14 years agolibext2fs: clean up ext2fs_bg_flags_ interfaces
Eric Sandeen [Mon, 26 Oct 2009 01:41:32 +0000 (21:41 -0400)]
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>
14 years agodebugfs: open file systems using EXT2_FLAG_64BITS
Eric Sandeen [Mon, 26 Oct 2009 01:41:13 +0000 (21:41 -0400)]
debugfs: open file systems using EXT2_FLAG_64BITS

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 years agoMerge branch 'maint' into next
Theodore Ts'o [Sat, 24 Oct 2009 19:14:54 +0000 (15:14 -0400)]
Merge branch 'maint' into next

Conflicts:
configure
configure.in

14 years agodebian: Add pre-depends for util-linux for util-linux-ng builds
Theodore Ts'o [Sat, 24 Oct 2009 19:04:54 +0000 (15:04 -0400)]
debian: Add pre-depends for util-linux for util-linux-ng builds

Addresses-Debian-Bug: #551795

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 years agoUpdate .gitignore
Michael Roth [Sat, 17 Oct 2009 11:26:51 +0000 (13:26 +0200)]
Update .gitignore

Signed-off-by: Michael Roth <mroth@nessie.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14 years agotune2fs.8: Clarify tune2fs's -i option
Theodore Ts'o [Sat, 24 Oct 2009 18:25:39 +0000 (14:25 -0400)]
tune2fs.8: Clarify tune2fs's -i option

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 years agodumpe2fs: Fix usage message for -o superblock=<num> and -o blocksize=<num>
Theodore Ts'o [Sat, 24 Oct 2009 18:15:55 +0000 (14:15 -0400)]
dumpe2fs: Fix usage message for -o superblock=<num> and -o blocksize=<num>

Addresses-Launchpad-Bug: #448099

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 years agoconfigure.in: Fix typo: remove '2' from blkid_probe_get_topology2
Eric Sandeen [Wed, 21 Oct 2009 07:43:02 +0000 (03:43 -0400)]
configure.in: Fix typo: remove '2' from blkid_probe_get_topology2

I think vim <esc>wq turned into <esc>2wq or something; in any case
blkid_probe_get_topology2 is not the right thing to search for.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
14 years agolibext2fs: Fix FEATURE_RO_COMPAT_HUGE_FILE && !HUGE_FILE_FL
Theodore Ts'o [Wed, 21 Oct 2009 05:46:58 +0000 (01:46 -0400)]
libext2fs: Fix FEATURE_RO_COMPAT_HUGE_FILE && !HUGE_FILE_FL

If the RO compat HUGE_FILE feature flag is set, but the inode's
HUGE_FILE_FL flag is not set, we should still pay attention to the
high 32 bits of the i_blocks filed.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 years agoe2fsck: Accept superblock times to be fudged by up to 24 hours by default
Theodore Ts'o [Sat, 17 Oct 2009 00:46:45 +0000 (20:46 -0400)]
e2fsck: Accept superblock times to be fudged by up to 24 hours by default

Unfortunately, due to Windows' unfortunate design decision to
configure the hardware clock to tick localtime, instead of the more
proper and less error-prone UTC time, many users end up in the
situation where the system clock is incorrectly set at the time when
e2fsck is run.

Historically this was usually due to some distributions having buggy
init scripts and/or installers that didn't correctly detect this case
and take appropriate countermeasures.  However, it's still possible,
despite the best efforts of init script and installer authors to not
be able to detect this misconfiguration, usually due to a buggy or
misconfigured virtualization manager or the installer not having
access to a network time server during the installation process.  So
by default, we allow the superblock times to be fudged by up to 24
hours.  This can be disabled by setting options.accept_time_fudge to
the boolean value of false in e2fsck.conf.  The old
options.buggy_init_scripts is left for backwards compatibility.

Since we are now accepting the 24 hour time fudge by default, there is
no longer a need to install an Ubuntu-specific e2fsck.conf file, so we
can remove it.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 years agoe2fsck: Fix handling of non-zero i_blocks_high field
Theodore Ts'o [Tue, 13 Oct 2009 01:59:37 +0000 (21:59 -0400)]
e2fsck: Fix handling of non-zero i_blocks_high field

E2fsck was not properly printing the i_blocks field in filesystem
corruption messages, and it was not properly checking i_blocks_hi and
i_blocks_lo, either.  This commit fixes this.

Thanks to Felipe Conteras for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 years agoMerge branch 'maint' into next
Theodore Ts'o [Mon, 5 Oct 2009 00:40:46 +0000 (20:40 -0400)]
Merge branch 'maint' into next

Conflicts:
configure
configure.in
misc/mke2fs.c

14 years agoe2fsck: Interpret negative blkcount in file system problem reports
Theodore Ts'o [Sun, 4 Oct 2009 22:02:24 +0000 (18:02 -0400)]
e2fsck: Interpret negative blkcount in file system problem reports

Non-expert users get confused when they see messages like this:

Illegal block #-1 (2291965952) in inode 176. CLEARED.

So change it to be something a little bit more understandable:

Illegal indirect block (2291965952) in inode 176.  CLEARED.

Addresses-SourceForge-Bug: #2871782

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 years agolibext2fs: Always build file_io.c
Theodore Ts'o [Sun, 4 Oct 2009 20:29:17 +0000 (16:29 -0400)]
libext2fs: Always build file_io.c

Commit 1d9b818: dumpe2fs: Print more information about the inline journal
caused dumpe2fs to use ext2fs_file_open2().  Previously the file_io
functions were only used by debugfs, so if debugfs was disabled,
file_io was not built.  Now that dumpe2fs is also using file_io, we
need to build it unconditionally.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 years agotests: Account for new mke2fs topology information
Theodore Ts'o [Sun, 4 Oct 2009 20:21:13 +0000 (16:21 -0400)]
tests: Account for new mke2fs topology information

The previous commit adds a new line printed by mke2fs with the
filesystem/device topology information.  Update the regression test's
expected output to account for this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 years agomke2fs: get device topology values from blkid
Eric Sandeen [Fri, 2 Oct 2009 16:32:42 +0000 (11:32 -0500)]
mke2fs: get device topology values from blkid

Handle automatic selection of stride/stripe:

mke2fs 1.41.9 (22-Aug-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=16 blocks, Stripe width=32 blocks
...

And warn on block device misalignment:

mke2fs 1.41.9 (22-Aug-2009)
/dev/sdc1 alignment is offset by 32256 bytes.
This may result in very poor performance, (re)-partitioning suggested.
Proceed anyway? (y,n)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14 years agoDon't use in-tree header files if using system uuid or blkid libraries
Theodore Ts'o [Sun, 4 Oct 2009 18:45:08 +0000 (14:45 -0400)]
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>
14 years agoe2fsck: Use the correct problem code in the case of LAST_WRITE_FUDGED
Theodore Ts'o [Sun, 4 Oct 2009 03:17:45 +0000 (23:17 -0400)]
e2fsck: Use the correct problem code in the case of LAST_WRITE_FUDGED

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 years agoblkid: Avoid a potentially error message when running "make clean"
Theodore Ts'o [Sun, 4 Oct 2009 02:33:47 +0000 (22:33 -0400)]
blkid: Avoid a potentially error message when running "make clean"

This error isn't terribly important, but apparently it causes some
users/developers distress.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 years agodebugfs: add matching fclose
Peng Tao [Mon, 28 Sep 2009 10:51:53 +0000 (18:51 +0800)]
debugfs: add matching fclose

If the cmd_file is not stdin, we should close the file handle via fclose().
Thanks David Binderman to point this out.

Addresses-Novell-Bugzilla: #524526

Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14 years agofix fd leak that causes fsck to fail with "too many open files"
Cristian Rodríguez [Fri, 2 Oct 2009 13:24:11 +0000 (09:24 -0400)]
fix fd leak that causes fsck to fail with "too many open files"

fsck leaks fds when invoked with -R -A -M -a -t noopts=nofail

Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agolibext2fs: Add error table initialization to test programs
Theodore Ts'o [Wed, 9 Sep 2009 01:33:03 +0000 (21:33 -0400)]
libext2fs: Add error table initialization to test programs

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2undo: Initialize com_err error tables for the ext2fs library
Theodore Ts'o [Wed, 9 Sep 2009 01:29:21 +0000 (21:29 -0400)]
e2undo: Initialize com_err error tables for the ext2fs library

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebugfs: Convert to support 64-bit filesystems
Valerie Aurora Henson [Tue, 8 Sep 2009 02:46:17 +0000 (22:46 -0400)]
debugfs: Convert to support 64-bit filesystems

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>
15 years agoConvert uses of super->s_*_blocks_count to ext2fs_*_blocks_count()
Valerie Aurora Henson [Tue, 8 Sep 2009 00:46:34 +0000 (20:46 -0400)]
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>
15 years agoUse ext2fs_file_acl_block() instead of using .i_file_acl directly
Valerie Aurora Henson [Tue, 8 Sep 2009 02:29:45 +0000 (22:29 -0400)]
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>
15 years agoFix overflow in calculation of total file system blocks
Valerie Aurora Henson [Tue, 8 Sep 2009 01:23:03 +0000 (21:23 -0400)]
Fix overflow in calculation of total file system blocks

Blocks per group and group desc count are both 32-bit; multiplied they
produce a 32-bit quantity which overflowed.

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>
15 years agolibext2fs: Round up the bitmap size when allocating a new bitmap
Theodore Ts'o [Mon, 7 Sep 2009 20:21:49 +0000 (16:21 -0400)]
libext2fs: Round up the bitmap size when allocating a new bitmap

The x86 BT assembly instructure can overshoot the end of a bit array
when testing a bit at the end of the bit array, even if it never needs
to look at those memory locations.  This can cause a spurious
segmentation fault.  If we allocate a little extra memory, it avoids
this problem.  See:

http://faydoc.tripod.com/cpu/bt.htm

This doesn't happen on Linux, probably because of the glibc's malloc()
function works, but apparently it's a major problem on the *BSD
operating systems.

Addresses-Sourceforge-Bug: #2328708

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agomke2fs.8.in: Clarify flex_bg feature description
Theodore Ts'o [Mon, 7 Sep 2009 19:17:51 +0000 (15:17 -0400)]
mke2fs.8.in: Clarify flex_bg feature description

Add a more explicit description of how specifying the flex_bg file
system feature changes the layout of the per-block group metadata.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agotune2fs.8: Document the flex_bg file system option in the man page
Theodore Ts'o [Mon, 7 Sep 2009 18:53:44 +0000 (14:53 -0400)]
tune2fs.8: Document the flex_bg file system option in the man page

Addresses-Sourceforge-Bug: #2822186

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoresize2fs: fix minimum resize size calculation with flex_bg
Peng Tao [Fri, 4 Sep 2009 09:15:40 +0000 (17:15 +0800)]
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>
15 years agoresize2fs: calculate minimal fs size only once
Peng Tao [Fri, 4 Sep 2009 07:22:39 +0000 (15:22 +0800)]
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>
15 years agoconfigure.in, configure: Drop --with-cc, --with-ccopts, --with-ldopts
Theodore Ts'o [Mon, 7 Sep 2009 01:28:47 +0000 (21:28 -0400)]
configure.in, configure: Drop --with-cc, --with-ccopts, --with-ldopts

Remove the configure options --with-cc, --with-ccopts, --with-ldopts,
and --with-ld (which never worked), since the first three can be
replaced with CC=, CCFLAGS=, and LDFLAGS= on the configure
command-line.  The default for --with-cc caused the CC= to be
overridden even with it was specified to the configure script.

Addresses-Sourceforge-Bug: #2843248

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodumpe2fs: Print more information about the inline journal
Theodore Ts'o [Sun, 6 Sep 2009 22:55:09 +0000 (18:55 -0400)]
dumpe2fs: Print more information about the inline journal

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebian: Make sure libblkid1 and libblkid1-dbg have changelogs
Theodore Ts'o [Wed, 2 Sep 2009 00:27:29 +0000 (20:27 -0400)]
debian: Make sure libblkid1 and libblkid1-dbg have changelogs

Thanks to Scott James Remnant <scott@canonical.com> for pointing this
problem and suggesting a fix.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Avoid scary failure messages on low-memory systems
Theodore Ts'o [Wed, 2 Sep 2009 00:01:38 +0000 (20:01 -0400)]
e2fsck: Avoid scary failure messages on low-memory systems

On a very low-memory system, where ext2fs_check_desc() fails because
it can't allocate a block bitmap, catch this error and report it
immediate.  This avoids something like this, which could scare and
mislead the user:

   e2fsck: Group descriptors look bad... trying backup blocks...
   Media was not cleanly unmounted, check forced.
   Pass 1: Checking inodes, blocks, and sizes
   Error allocating block bitmap (1): Memory allocation failed
   e2fsck: aborted

Addresses-Debian-Bug: #509529

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoblkid: support .ko.gz in modules.dep parser
Karel Zak [Sun, 23 Aug 2009 19:13:56 +0000 (21:13 +0200)]
blkid: support .ko.gz in modules.dep parser

The Linux kernel modules could be compressed, it means modules.dep
parser in libblid has to support .ko.gz extension too.

(Note, I've talked about this problem with Jon Masters and his
suggestion is to exec(/sbin/modinfo) rather than directly parse
modules.dep. BTW, the modules.dep file is deprecated.)

Address-Red-Hat-Bug: #518572
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agotune2fs: Fix "tune2fs -j <dev>" for extent-enabled filesystems
Theodore Ts'o [Tue, 25 Aug 2009 14:07:16 +0000 (10:07 -0400)]
tune2fs: Fix "tune2fs -j <dev>" for extent-enabled filesystems

For filesystms that have the extent feature enabled, we need to grab
the use EXT2_IOC_GETFLAGS so that we don't accidentally end up trying
to request clearing the EXT2_EXTENT_FL, which is not supported and
causes the tune2fs -j error out.

Also fix the error returning in ext2fs_add_journal_inode() so it
returns a proper error code if the fstat() or ioctl() calls fail.

Addresses-Launchpad-bug: #416648

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibext2fs: create generic numeric progress meters and use them
Valerie Aurora Henson [Sun, 23 Aug 2009 23:20:03 +0000 (19:20 -0400)]
libext2fs: create generic numeric progress meters and use them

With 64-bit file systems, mke2fs can take a long time to do things
other than write inode tables.  I exported the mke2fs numeric progress
meter and used it for allocating group tables and the final file
system flush.

Signed-off-by: Valerie Aurora (Henson) <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUse accessor functions fields for bg_flags in the block group descriptors
Theodore Ts'o [Tue, 8 Sep 2009 01:15:12 +0000 (21:15 -0400)]
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>
15 years agoConvert to use io_channel_read_blk64() and io_channel_write_blk64()
Valerie Aurora Henson [Tue, 8 Sep 2009 01:14:24 +0000 (21:14 -0400)]
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>
15 years agolibext2fs: Fix counting routines in blknum.c to take/return __u32 counts
Nick Dokos [Tue, 8 Sep 2009 01:13:59 +0000 (21:13 -0400)]
libext2fs: Fix counting routines in blknum.c to take/return __u32 counts

Several routines in lib/ext2fs/blknum.c:

        ext2fs_bg_free_blocks_count()
        ext2fs_bg_free_inodes_count()
        ext2fs_bg_used_dirs_count()
        ext2fs_bg_itable_unused()

and their _set() counterparts, operate as if they are dealing with
blk64_t quantities, but they should be dealing with __u32 counts
instead.

Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoMerge branch 'maint' into next
Theodore Ts'o [Mon, 7 Sep 2009 21:02:35 +0000 (17:02 -0400)]
Merge branch 'maint' into next

15 years agoe4defrag: fix ppc build
Kyle McMartin [Mon, 24 Aug 2009 05:09:58 +0000 (22:09 -0700)]
e4defrag: fix ppc build

ppc glibc seems to be missing sync_file_range, so we fell back
to the local define, and there ppc differs as well, so the
build was failing.

Thanks to Kyle for the patch w/ the tidy solution.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoe4defrag: Link with ext2fs library
Theodore Ts'o [Mon, 24 Aug 2009 02:34:28 +0000 (22:34 -0400)]
e4defrag: Link with ext2fs library

Since e4defrag uses ext2fs_swab32, it needs to link against the ext2fs
library.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agomke2fs.conf: Use the feature name "extent" instead of "extents"
Theodore Ts'o [Sun, 23 Aug 2009 19:06:48 +0000 (15:06 -0400)]
mke2fs.conf: Use the feature name "extent" instead of "extents"

The feature name "extent" is documented in mke2fs.conf, although both
"extent" and "extents" are accepted by e2fsprogs.

Addreses-Debian-Bug: #540111

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoFix debian packaging to work correctly on post-Lenny systems
Theodore Ts'o [Sun, 23 Aug 2009 14:09:36 +0000 (10:09 -0400)]
Fix debian packaging to work correctly on post-Lenny systems

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2freefrag: Update manpage to include e2fsprogs version and release date
Theodore Ts'o [Sun, 23 Aug 2009 03:41:49 +0000 (23:41 -0400)]
e2freefrag: Update manpage to include e2fsprogs version and release date

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUpdate release notes, version string, etc. for E2fsprogs 1.41.9 release v1.41.9
Theodore Ts'o [Sun, 23 Aug 2009 02:38:50 +0000 (22:38 -0400)]
Update release notes, version string, etc. for E2fsprogs 1.41.9 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agomake-sparse: Write a zero-byte at the end of the image
Theodore Ts'o [Sun, 23 Aug 2009 03:02:41 +0000 (23:02 -0400)]
make-sparse: Write a zero-byte at the end of the image

This is necessary to preserve the i_size of the output file; otherwise
programs like e2fsck will complain that the filesystem has been
truncated.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoresize2fs: Move everything to new bitmap interface
Valerie Aurora Henson [Sun, 23 Aug 2009 01:13:37 +0000 (21:13 -0400)]
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>
15 years agoConvert tune2fs, dumpe2fs, and e2image to the new bitmap interface
Valerie Aurora Henson [Sun, 23 Aug 2009 01:15:30 +0000 (21:15 -0400)]
Convert tune2fs, dumpe2fs, and e2image to the new bitmap interface

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebugfs: Move everything to new bitmap interface
Valerie Aurora Henson [Sun, 23 Aug 2009 00:22:42 +0000 (20:22 -0400)]
debugfs: Move everything to new bitmap interface

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Convert e2fsck to new bitmap interface
Valerie Aurora Henson [Sun, 23 Aug 2009 02:29:02 +0000 (22:29 -0400)]
e2fsck: Convert e2fsck to new bitmap interface

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agotune2fs: handle bad blocks when resizing inodes
Aneesh Kumar K.V [Thu, 6 Aug 2009 06:12:31 +0000 (11:42 +0530)]
tune2fs: handle bad blocks when resizing inodes

When increasing inode size if we find that the new block
that we needed to increase the inode table size is a bad
block we fail. This make sure we don't end up with a corrupt
file system when doing inode resize on a file system having
bad blocks.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agotune2fs: Handle fs meta-data blocks during inode resize
Aneesh Kumar K.V [Thu, 6 Aug 2009 06:12:30 +0000 (11:42 +0530)]
tune2fs: Handle fs meta-data blocks during inode resize

With file system formated for RAID arrays we can have inode bitmap
and block bitmap after inode table. Make sure we move them around
properly when doing inode resize.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agotune2fs: Make e2fsprogs handle ENOSPC better with inode resize
Aneesh Kumar K.V [Thu, 6 Aug 2009 06:12:29 +0000 (11:42 +0530)]
tune2fs: Make e2fsprogs handle ENOSPC better with inode resize

This removes the metadata block bitmap and makes the error handling
simpler. It also check for the enospc with the correct number needed
blocks. Also added specific error messages. We need to run e2undo
only if we start modiyfing inode, group desc and inode table.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agof_illitable_flexbg: Add new test
Theodore Ts'o [Wed, 19 Aug 2009 05:16:47 +0000 (01:16 -0400)]
f_illitable_flexbg: Add new test

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Add a global latch question for bad group descriptor checksums
Theodore Ts'o [Wed, 19 Aug 2009 05:06:50 +0000 (01:06 -0400)]
e2fsck: Add a global latch question for bad group descriptor checksums

Very often all the block group descriptors will have bad checksums, so
don't force the user answer 'yes' many, many times.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Only ask to relocate a block group's inode table once
Theodore Ts'o [Wed, 19 Aug 2009 03:14:03 +0000 (23:14 -0400)]
e2fsck: Only ask to relocate a block group's inode table once

If multiple blocks of a block group's inode table overlaps with other
file system blocks, only ask once for each block group.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Teach new_table_block() to allocate new itables/bitmaps with FLEX_BG
Theodore Ts'o [Wed, 19 Aug 2009 02:27:42 +0000 (22:27 -0400)]
e2fsck: Teach new_table_block() to allocate new itables/bitmaps with FLEX_BG

If the filesystem feature FLEX_BG is enabled, the inode table and
bitmap blocks can be located anywhere in the inode table.  So for
FLEX_BG filesystems, new_table_block() now tries allocate in the block
group's flex_bg first, and if there is no space in the local flex_bg,
then try to allocate from the whole filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agofilefrag: don't print extent header on bmap fallback
Eric Sandeen [Thu, 6 Aug 2009 03:30:48 +0000 (22:30 -0500)]
filefrag: don't print extent header on bmap fallback

The extent list header gets printed before we fall back to bmap:

# filefrag -v /mnt/test/bar
Filesystem type is: 58465342
File size of /mnt/test/bar is 12288 (3 blocks, blocksize 4096)
 ext logical physical expected length flags <---- HERE
Discontinuity: Block 2 is at 17 (was 16)
/mnt/test/bar: 2 extents found

so delay printing it until we know fiemap is working.

(though ideally it'd be nice to have the same verbose output
regardless of the interface we used, I think).

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agofilefrag: fix frag count in bmap case
Eric Sandeen [Thu, 6 Aug 2009 02:43:23 +0000 (21:43 -0500)]
filefrag: fix frag count in bmap case

The fragmentation count in the bmap case seems to be
off by one:

/mnt/test/bar: 0 extents found

Addresses-Debian-Bug: #540376

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agofilefrag: Add option to force use of the FIBMAP ioctl
Theodore Ts'o [Sun, 16 Aug 2009 03:15:44 +0000 (23:15 -0400)]
filefrag: Add option to force use of the FIBMAP ioctl

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibext2fs: Treat uninitialized parts of bitmaps as unallocated
Theodore Ts'o [Mon, 10 Aug 2009 02:55:55 +0000 (22:55 -0400)]
libext2fs: Treat uninitialized parts of bitmaps as unallocated

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoAdd V=1 support when linking e2freefrag in misc/Makefile.in
Theodore Ts'o [Mon, 10 Aug 2009 02:48:32 +0000 (22:48 -0400)]
Add V=1 support when linking e2freefrag in misc/Makefile.in

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2freefrag: Take into account the last free extent in the file system
Theodore Ts'o [Mon, 10 Aug 2009 00:15:46 +0000 (20:15 -0400)]
e2freefrag: Take into account the last free extent in the file system

Fix a bug in e2freefrag where if the last free extent is at the very
end of the filesystem, it would be disregarded.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2freefrag: Fix to work correctly for file systems with 1kb block sizes
Theodore Ts'o [Mon, 10 Aug 2009 00:09:10 +0000 (20:09 -0400)]
e2freefrag: Fix to work correctly for file systems with 1kb block sizes

If the file system has a non-zero s_first_data_block, as is the case
when the block size is 1kb, e2freefrag would incorrectly try to
reference invalid data blocks in the block allocation bitmap.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2freefrag: Do not print chunk-related information by default
Theodore Ts'o [Sun, 9 Aug 2009 23:40:14 +0000 (19:40 -0400)]
e2freefrag: Do not print chunk-related information by default

Only print information related to chunk sizes if a chunksize is
printed.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2freefrag: Clarify e2freefrag's messages
Theodore Ts'o [Sun, 9 Aug 2009 23:29:30 +0000 (19:29 -0400)]
e2freefrag: Clarify e2freefrag's messages

"Free chunks" is confusing since it has nothing to do with the
chunksize; use "free extents" instead.

Also add a missing newline in an error message.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2freefrag: Initialize the ext2 error table
Theodore Ts'o [Sun, 9 Aug 2009 23:15:45 +0000 (19:15 -0400)]
e2freefrag: Initialize the ext2 error table

... so error messages are printed correctly

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Fix and enhance superblock dates in future problem reports
Theodore Ts'o [Sat, 8 Aug 2009 14:14:48 +0000 (10:14 -0400)]
e2fsck: Fix and enhance superblock dates in future problem reports

Fixed a bug where e2fsck would report that last mount time was in the
future when it was really the last write time that was in the future.

Also, since people can't seem to believe that (a) their distribution
has buggy init scripts, or (b) their CMOS/RTC clock or backup battery
is dead, print the incorrect time and the current system time.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoConvert mke2fs to new bitmap interface
Valerie Aurora Henson [Wed, 5 Aug 2009 04:17:56 +0000 (00:17 -0400)]
Convert mke2fs to new bitmap interface

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoConvert libext2fs to 64-bit bitmap interface
Valerie Aurora Henson [Wed, 5 Aug 2009 04:27:10 +0000 (00:27 -0400)]
Convert libext2fs to 64-bit bitmap interface

(Includes fixes from Nick Dokos)

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>
15 years agoAdd support for 64-bit bitmaps
Theodore Ts'o [Sat, 22 Aug 2009 17:27:40 +0000 (13:27 -0400)]
Add support for 64-bit bitmaps

Initial design was done by Theodore Ts'o; implementation was fleshed
out by Valerie Aurora Henson.  Also includes some fixes from Nick Dokos.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
15 years agoe2fsck: Allow cancellation during group descriptor checks.
Valerie Aurora Henson [Wed, 5 Aug 2009 02:48:15 +0000 (22:48 -0400)]
e2fsck: Allow cancellation during group descriptor checks.

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoMerge branch 'maint' into next
Theodore Ts'o [Sat, 22 Aug 2009 17:18:29 +0000 (13:18 -0400)]
Merge branch 'maint' into next

15 years agoMove declaration of FS_IOC_FIEMAP ioctl to fiemap.h
Theodore Ts'o [Sat, 22 Aug 2009 17:16:14 +0000 (13:16 -0400)]
Move declaration of FS_IOC_FIEMAP ioctl to fiemap.h

This helps e4defrag compile on systems where the system header files
don't yet define FS_IOC_FIEMAP.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoMerge branch 'maint' into next
Theodore Ts'o [Sun, 2 Aug 2009 00:43:00 +0000 (20:43 -0400)]
Merge branch 'maint' into next

Conflicts:
misc/Makefile.in

15 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Wed, 29 Jul 2009 23:22:06 +0000 (19:22 -0400)]
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Tue, 28 Jul 2009 16:23:22 +0000 (12:23 -0400)]
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Tue, 28 Jul 2009 15:44:42 +0000 (11:44 -0400)]
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Tue, 28 Jul 2009 15:44:42 +0000 (11:44 -0400)]
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoe4defrag: remove a lot of cruft
Eric Sandeen [Mon, 27 Jul 2009 14:53:46 +0000 (10:53 -0400)]
e4defrag: remove a lot of cruft

e4defrag.c had a lot of stuff copied into it from other
places, redefinitions of existing interfaces, etc.

We should be able to remove most of this, as the tool only
works on recent kernels anyway, we should just pick up
definitions from recent kernel headers whenever possible.

I've left the local definitions of fallocate, fadvise
(changed to posix_fadvise) and sync_file_range, and
wrapped them in #ifdef configure-time tests - though
really it seems like only fallocate should be necessary
by now, and perhaps the others can be dropped.

We still need some Makefile work so that it won't try to
build e4defrag if the right pieces aren't there (and
if the local definitions won't work...)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebugfs: Add the new command dump_extents and extent the stat command
Theodore Ts'o [Mon, 27 Jul 2009 02:29:47 +0000 (22:29 -0400)]
debugfs: Add the new command dump_extents and extent the stat command

Extend the stat command to display more detailed extent information if
the file uses extent mapping instead of displaying the block map using
the block_iterate funtion.

Add the command dump_extents which displays even more detailed
information about an inode's extent tree.

This commit is an extension of a patch from Curt Wohlgemuth.

Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2freefrag: Improve output to include be more like xfs_db's freesp -s
Andreas Dilger [Fri, 24 Jul 2009 22:32:25 +0000 (18:32 -0400)]
e2freefrag: Improve output to include be more like xfs_db's freesp -s

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Fri, 24 Jul 2009 14:28:43 +0000 (10:28 -0400)]
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoe2freefrag: New program which displays how fragmented the free space is
Theodore Ts'o [Wed, 22 Jul 2009 07:40:58 +0000 (03:40 -0400)]
e2freefrag: New program which displays how fragmented the free space is

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibext2fs: Use blk_t instead of int in ext2fs_allocate_group_table
Theodore Ts'o [Wed, 22 Jul 2009 06:38:16 +0000 (02:38 -0400)]
libext2fs: Use blk_t instead of int in ext2fs_allocate_group_table

We are using a signed int to store a block number in
ext2fs_allocate_group_table.  We don't actually do any computation or
comparisons using it, so it shouldn't cause any bugs, but it's
technically incorrect, and it's possible an overly clever compiler
might do something wrong with it.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUpdate debian changelog and RELEASE-NOTES for interim release
Theodore Ts'o [Mon, 20 Jul 2009 13:40:46 +0000 (09:40 -0400)]
Update debian changelog and RELEASE-NOTES for interim release

15 years agolibext2fs: Avoid creating unneeded new extents in ext2fs_extent_set_bmap()
Theodore Ts'o [Mon, 20 Jul 2009 03:37:44 +0000 (23:37 -0400)]
libext2fs: Avoid creating unneeded new extents in ext2fs_extent_set_bmap()

Avoiding inserting a new extent if it is possible to merge the new
block to the beginning or the end of the previous or next extent.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibext2fs: Improve debugging printf's in extent.c
Theodore Ts'o [Mon, 20 Jul 2009 03:32:09 +0000 (23:32 -0400)]
libext2fs: Improve debugging printf's in extent.c

Comment out less common debugging printf's, and fix some type
warnings.  Add high-level debugging printf's for ext2fs_extent_goto(),
ext2fs_extent_insert(), ext2fs_extent_delete(), ext2fs_extent_replace()

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibext2fs: Fix regression in ext2fs_extent_set_bmap()
Theodore Ts'o [Mon, 20 Jul 2009 02:43:33 +0000 (22:43 -0400)]
libext2fs: Fix regression in ext2fs_extent_set_bmap()

Commit 0dc291611 introduced a regression when unmapping the first
block in an extent.  This caused e2fsck -fD to corrupt large
directories if the directory has to shrink by more than one block.
The problem was set_bmap should only go to a next leaf when setting a
first block in an extent, and not when it is unmapping the first block
in an extent.

Addresses-Debian-Bug: #537510

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebian: Allow building with util-linux-ng
Theodore Ts'o [Sun, 19 Jul 2009 02:14:58 +0000 (22:14 -0400)]
debian: Allow building with util-linux-ng

If building with util-linux-ng, we will use the external libblkid and
libuuid, as well as disabling the internal fsck.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agomke2fs: Add strings.h include for strcasecmp() declaration
Theodore Ts'o [Sat, 18 Jul 2009 22:41:51 +0000 (18:41 -0400)]
mke2fs: Add strings.h include for strcasecmp() declaration

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebian/control: fix incorrect use of apostrophe's
Scott James Remnant [Wed, 15 Jul 2009 14:43:21 +0000 (15:43 +0100)]
debian/control: fix incorrect use of apostrophe's

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoFix release date, to silence configure complaints
Matthias Andree [Wed, 15 Jul 2009 15:37:53 +0000 (17:37 +0200)]
Fix release date, to silence configure complaints

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoFix intl/ build: add E/Q/V macros, process intl/libgnuintl.h
Matthias Andree [Wed, 15 Jul 2009 15:37:52 +0000 (17:37 +0200)]
Fix intl/ build: add E/Q/V macros, process intl/libgnuintl.h

These were found necessary to build on FreeBSD 6.4.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>