Whamcloud - gitweb
tools/e2fsprogs.git
15 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>
15 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 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 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 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 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 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>
15 years agolibext2fs: fix memory leak in error path in ext2fs_block_iterate2()
Theodore Ts'o [Sat, 18 Jul 2009 14:02:41 +0000 (10:02 -0400)]
libext2fs: fix memory leak in error path in ext2fs_block_iterate2()

Reported-by: Nic Case <number9652@yahoo.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agofilefrag: fix it so it works in the bmap fallback case.
Eric Sandeen [Wed, 15 Jul 2009 20:22:55 +0000 (15:22 -0500)]
filefrag: fix it so it works in the bmap fallback case.

It looks like some debugging crept in?

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoe2fsck: Fix superblock times in the future even if buggy_init_scripts=1
Theodore Ts'o [Fri, 17 Jul 2009 03:44:50 +0000 (23:44 -0400)]
e2fsck: Fix superblock times in the future even if buggy_init_scripts=1

Unfortunately, distributions like Ubuntu seem to have buggy init
scripts that run e2fsck and mount the root filesystem before making
sure the system time and time zone is correctly set.  As a result, a
filesystem's last write and last mounted time can be set in future.
The buggy_init_scripts configuration option will stop e2fsck from
aborting the boot process, but it also inhibits the superblock times
from getting fixed.  This causes resize2fs to refuse to resize the
filesystem, even after running e2fsck on the file system.  To deal
with this, we need to fix the superblock write times unconditionally.

Addresses-Launchpad-bug: #373409

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibext2fs: Fix minor gcc -Wall warnings
Theodore Ts'o [Sun, 12 Jul 2009 05:13:06 +0000 (01:13 -0400)]
libext2fs: Fix minor gcc -Wall warnings

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoFix miscellaneous gcc -Wall warnings in blkid and tune2fs
Theodore Ts'o [Sun, 12 Jul 2009 03:56:49 +0000 (23:56 -0400)]
Fix miscellaneous gcc -Wall warnings in blkid and tune2fs

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agofilefrag: Restore "perfect" number of extents calculation for ext2/ext3
Theodore Ts'o [Sun, 12 Jul 2009 03:44:56 +0000 (23:44 -0400)]
filefrag: Restore "perfect" number of extents calculation for ext2/ext3

The FIEMAP support added in e2fsprogs 1.41.6 broke the "perfection
would be XXX expects" calculation restore it.

Also fix some gcc -Wall warnings as well.  (Cleaning up gcc -Wall is
what caused me to notice this regression).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebugfs: Fix miscellaneous gcc -Wall warnings
Theodore Ts'o [Sun, 12 Jul 2009 03:23:16 +0000 (23:23 -0400)]
debugfs: Fix miscellaneous gcc -Wall warnings

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebian: Don't use dietlibc when building for mips and mipsel
Theodore Ts'o [Sat, 11 Jul 2009 23:48:48 +0000 (19:48 -0400)]
debian: Don't use dietlibc when building for mips and mipsel

Dietlibc seems to fail when building e2fsprogs for the mips and mipsel
architectures.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUpdate date in the RELEASE-NOTES file.
Theodore Ts'o [Sat, 11 Jul 2009 23:21:43 +0000 (19:21 -0400)]
Update date in the RELEASE-NOTES file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUpdate release notes, version string, etc. for E2fsprogs 1.41.8 release v1.41.8
Theodore Ts'o [Sat, 11 Jul 2009 22:29:56 +0000 (18:29 -0400)]
Update release notes, version string, etc. for E2fsprogs 1.41.8 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoRemove tst_csum.c from lib/ext2fs/Makefile.in's SRCS list
Theodore Ts'o [Sat, 11 Jul 2009 21:41:07 +0000 (17:41 -0400)]
Remove tst_csum.c from lib/ext2fs/Makefile.in's SRCS list

The tst_csum test is now part of csum.c, so there isn't a separate
tst_csum.c file that should be listed as one of the source files in
lib/ext2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebian: Update standards version to 3.8.2
Theodore Ts'o [Sat, 11 Jul 2009 21:22:16 +0000 (17:22 -0400)]
debian: Update standards version to 3.8.2

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUpdate the sample e2fsprogs.spec.in RPM spec file to mention ext3/ext4
Theodore Ts'o [Sat, 11 Jul 2009 20:22:51 +0000 (16:22 -0400)]
Update the sample e2fsprogs.spec.in RPM spec file to mention ext3/ext4

Update the description to indicate the e2fsprogs packages are also
used for ext3 and ext4 filesystems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebian: Update package descriptions to mention ext3/ext4 filesystems
Theodore Ts'o [Sat, 11 Jul 2009 20:05:39 +0000 (16:05 -0400)]
debian: Update package descriptions to mention ext3/ext4 filesystems

E2fsprogs is used for ext2, ext3, and ext4 filesystems.  Update the
package descriptions accordingly:

Addresses-Debian-Bug: #535530

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agopo: update id.po (from translationproject.org)
Arif E. Nugroho [Sat, 11 Jul 2009 18:36:16 +0000 (14:36 -0400)]
po: update id.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoresize2fs: If resize2fs fails, tell the user to run e2fsck
Theodore Ts'o [Fri, 10 Jul 2009 17:14:00 +0000 (13:14 -0400)]
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>
15 years agolibext2fs: Make ext2fs_extent_set_bmap() more robust against ENOSPC
Theodore Ts'o [Fri, 10 Jul 2009 04:19:28 +0000 (00:19 -0400)]
libext2fs: Make ext2fs_extent_set_bmap() more robust against ENOSPC

In the case where we ext2fs_extent_set_bmap() is replacing the block
mapping at the beginning of an already-existing extent, insert a new
extent if necessary before shrinking an existing extent, to avoid data
loss if the disk is full.

This mostly addresses the problem described in Red Hat Bugzilla's
statistics are still wrong, but at least the files on the filesystem
are not corrupted.  If there is a failure during the
inode_scan_and_fix pass, the simplest thing to do may be to tell the
user to run e2fsck -fy.

Addresses-Red-Hat-Bug: #510379

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibext2fs: Add new function ext2fs_test_inode_bitmap_range()
Theodore Ts'o [Thu, 9 Jul 2009 18:32:52 +0000 (14:32 -0400)]
libext2fs: Add new function ext2fs_test_inode_bitmap_range()

Optimize ext2fs_test_block_bitmap_range() and add a new function,
ext2fs_test_inode_bitmap_range(), which works the same way as
ext2fs_block_bitmap_range() but for inode bitmaps.  It's needed for
some code in the development branch, so let's drop it into the maint
branch to make life easier in the future.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoInterim in-progress update of the release notes and debian/changelog
Theodore Ts'o [Thu, 9 Jul 2009 12:09:58 +0000 (08:09 -0400)]
Interim in-progress update of the release notes and debian/changelog

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Thu, 9 Jul 2009 12:05:12 +0000 (08:05 -0400)]
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agolibext2fs: reset handle after inserting new extent
Eric Sandeen [Tue, 7 Jul 2009 19:30:32 +0000 (14:30 -0500)]
libext2fs: reset handle after inserting new extent

Commit 53422e moved the new extent insertion in
ext2fs_extent_set_bmap() prior to the modification of the original
extent, but the insert function left the handle pointing to the new
extent.  This left us modifying the -new- extent, instead of the
original one, and winding up with a corrupt extent tree something
like:

BLOCKS:
(0-1):588791-588792, (0):588791

We need to move back to the previous extent prior
to modification, if we inserted a new one.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoe2fsck: remove unused variable in check_block_bitmap()
Kazuya Mio [Mon, 6 Jul 2009 08:16:32 +0000 (17:16 +0900)]
e2fsck: remove unused variable in check_block_bitmap()

check_block_bitmap() calculates the block number of superblock in the current
block group but it's not used.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoe2fsck: optimize loop counter when fixing bitmap padding
Kazuya Mio [Mon, 6 Jul 2009 08:15:24 +0000 (17:15 +0900)]
e2fsck: optimize loop counter when fixing bitmap padding

If unused range of the bitmap has an unmarked bit, check_[inode/block]_end()
marks all bits in the range. However, we know that the checked bits are marked.
So this patch fixes loop counter to mark from the unmarked bit.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoe2fsck: remove unnecessary continue statement
Kazuya Mio [Mon, 6 Jul 2009 08:14:13 +0000 (17:14 +0900)]
e2fsck: remove unnecessary continue statement

Remove the continue statement because it calls at the end of the loop.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoEnhance build system so that "make V=1" works like the Linux Kernel
Theodore Ts'o [Thu, 2 Jul 2009 22:19:10 +0000 (18:19 -0400)]
Enhance build system so that "make V=1" works like the Linux Kernel

If gmake is available, the developer can use "make V=1" instead of
using a configure-time switch, --enable-verbose-makecmds, to see all
of the commands executed by the Makefile.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoresize2fs: Fix error message so the mountpoint is printed correctly
Theodore Ts'o [Thu, 2 Jul 2009 17:54:22 +0000 (13:54 -0400)]
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>
15 years agoAdd e2croncheck script to the contrib directory
Theodore Ts'o [Thu, 2 Jul 2009 15:39:23 +0000 (11:39 -0400)]
Add e2croncheck script to the contrib directory

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Thu, 2 Jul 2009 15:04:52 +0000 (11:04 -0400)]
po: update fr.po (from translationproject.org)

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

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agofilefrag: fix fm_start in filefrag_fiemap loop
Peng Tao [Thu, 2 Jul 2009 04:24:15 +0000 (00:24 -0400)]
filefrag: fix fm_start in filefrag_fiemap loop

When used with -v and the targeted file has more than 144
extents(double of the length of fm_extents array provided by buf),
filefrag_fiemap loops and calls fiemap ioctl() multiple times to
calculate the actual number of extents in a file. Each call to fiemap
ioctl() uses fm_start as the starting logical offset. The patch fixes
fm_start in each loop( except for the first one) and makes the extent
calculation correct for files with more that 144 extents.

To produce the problem, first run filefrag -v on a highly fragmented
file.  Then change the buf size in filefrag_fiemap to make it large
enough to have all the extent mapped in a single loop and run filefrag
-v after recompiling.  The former will produce a much smaller extent
count because of the false fm_start used in the loop. And the two will
produce different extent output since the 145th extent.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoremove bogus "-e" option from filefrag manpage
Peng Tao [Fri, 5 Jun 2009 10:13:28 +0000 (18:13 +0800)]
remove bogus "-e" option from filefrag manpage

filefrag doesn't support "-e" option, so clean it up in the manpage.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoAdd support for configure --enable-verbose-makecmds
Theodore Ts'o [Thu, 2 Jul 2009 04:11:17 +0000 (00:11 -0400)]
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>
15 years agoFix Makefile dependencies for libcom_err
Theodore Ts'o [Thu, 2 Jul 2009 02:06:51 +0000 (22:06 -0400)]
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>
15 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Thu, 2 Jul 2009 01:32:26 +0000 (21:32 -0400)]
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoFix compilation problem when building with --disable-uuid
Theodore Ts'o [Wed, 1 Jul 2009 21:20:24 +0000 (17:20 -0400)]
Fix compilation problem when building with --disable-uuid

The MCONFIG.in file used $(LIBUUID) in the definition of DEPLIBBLKID,
when it should have used $(DEPLIBUUID) instead.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUpdate Czech translation of e2fsprogs
Theodore Ts'o [Wed, 1 Jul 2009 15:02:08 +0000 (11:02 -0400)]
Update Czech translation of e2fsprogs

15 years agolibuuid: Don't run uuidd if it would fail due to permission problems
Theodore Ts'o [Wed, 1 Jul 2009 02:36:28 +0000 (22:36 -0400)]
libuuid: Don't run uuidd if it would fail due to permission problems

Some distributions don't like installing uuidd setuid or setgid.  So
if the setuid or setigid bit is not set with uuidd, and the current
process does not have write access to the UUIDD work directory, don't
try running uuidd, since it won't work properly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoDo not build and install uuidgen from if the uuid library was disabled.
Theodore Ts'o [Wed, 1 Jul 2009 01:34:08 +0000 (21:34 -0400)]
Do not build and install uuidgen from if the uuid library was disabled.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibuuid, uuidd: Avoid infinite loop while reading from the socket fd
Theodore Ts'o [Tue, 30 Jun 2009 00:03:20 +0000 (20:03 -0400)]
libuuid, uuidd: Avoid infinite loop while reading from the socket fd

If for some reason the uuidd daemon or the process calling uuidd
exited unexpectely, the read_all() function would end up looping
forever, either in uuidd or in libuuid.  Fix this terminating the loop
if no data can be read after five tries to read from the file
descriptor.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agouuidd: Avoid closing the server socket when calling create_daemon()
Theodore Ts'o [Mon, 29 Jun 2009 23:32:50 +0000 (19:32 -0400)]
uuidd: Avoid closing the server socket when calling create_daemon()

In the event that file descriptors 0-2 are closed when uuidd is
started, the server socket could be created as a file descriptor that
will get closed when create_daemon() tries detaching the uuidd daemon
from its controlling tty.   Avoid this case by using dup(2).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibuuid: Make sure fd's 0, 1, and 2 are valid before exec'ing uuidd
Theodore Ts'o [Mon, 29 Jun 2009 23:06:45 +0000 (19:06 -0400)]
libuuid: Make sure fd's 0, 1, and 2 are valid before exec'ing uuidd

When closing all of the file descriptors before starting uuidd, make
sure file descriptors 0, 1, and 2 are reserved by opening /dev/null.
This prevents strange bugs caused by assumptions regarding file
descriptors <= 2 as being special.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUpdate release notes, version string, etc. for E2fsprogs 1.41.7 release v1.41.7
Theodore Ts'o [Mon, 29 Jun 2009 16:56:04 +0000 (12:56 -0400)]
Update release notes, version string, etc. for E2fsprogs 1.41.7 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUpdate Czech and Chinese translations from the Translation Project.
Theodore Ts'o [Mon, 29 Jun 2009 19:08:12 +0000 (15:08 -0400)]
Update Czech and Chinese translations from the Translation Project.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agologsave: Don't send the ^A and ^B delimiters to the console
Theodore Ts'o [Mon, 29 Jun 2009 18:58:07 +0000 (14:58 -0400)]
logsave: Don't send the ^A and ^B delimiters to the console

Some terminal programs may print wierd characters when they see the
\001 or \002 characters.  So filter them out if the -s option
(skip_mode) is enabled.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>