OSDN Git Service

android-x86/external-e2fsprogs.git
15 years agoUpdate release notes, version string, etc. for E2fsprogs 1.41.5 release
Theodore Ts'o [Fri, 24 Apr 2009 02:44:16 +0000 (22:44 -0400)]
Update release notes, version string, etc. for E2fsprogs 1.41.5 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUpdate translation template file for 1.41.5 release
Theodore Ts'o [Fri, 24 Apr 2009 02:25:18 +0000 (22:25 -0400)]
Update translation template file for 1.41.5 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUpdate lib/ext2fs/Makefile.in using "make depend"
Theodore Ts'o [Fri, 24 Apr 2009 02:24:51 +0000 (22:24 -0400)]
Update lib/ext2fs/Makefile.in using "make depend"

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: On a 32-bit filesystem, make sure i_file_acl_high is zero
Theodore Ts'o [Fri, 24 Apr 2009 01:31:16 +0000 (21:31 -0400)]
e2fsck: On a 32-bit filesystem, make sure i_file_acl_high is zero

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoInterim commit for Debian release -- 1.41.4-3
Theodore Ts'o [Thu, 23 Apr 2009 05:57:51 +0000 (01:57 -0400)]
Interim commit for Debian release -- 1.41.4-3

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibext2fs: read the block group descriptors more efficiently
Theodore Ts'o [Thu, 23 Apr 2009 05:30:42 +0000 (01:30 -0400)]
libext2fs: read the block group descriptors more efficiently

When opening a filesystem, make ext2fs_open2() much more efficient by
reading the normal block group descriptors all at once, instead of one
block at a time.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Reduce unnecessary I/O when checking backup superblock
Theodore Ts'o [Thu, 23 Apr 2009 05:27:07 +0000 (01:27 -0400)]
e2fsck: Reduce unnecessary I/O when checking backup superblock

E2fsck needs to check to see if the backup superblock differs from the
primary superblock.  Previously it was doing so by calling
ext2fs_open(), which does a lot of unnecessary work, including reading
all of the backup block group descriptors.  Avoid this by reading in
the backup superblock directly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Don't test the resize_inode if the filesystem is clean
Theodore Ts'o [Thu, 23 Apr 2009 04:39:06 +0000 (00:39 -0400)]
e2fsck: Don't test the resize_inode if the filesystem is clean

Move check_resize_inode() out of check_super_block(), since we only
need to test the resize_inode for correctness only if the filesystem
requires checking.  This change avoids a lot of I/O operations which
slows down a 1 second boot.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoblkid: remove whole-disk entries from cache when partitions are found
Eric Sandeen [Thu, 23 Apr 2009 03:51:51 +0000 (22:51 -0500)]
blkid: remove whole-disk entries from cache when partitions are found

We can get into a situation in blkid where whole disks remain
in the cache, even though partitions are found.  For labels
such as sun disklabels which may have the first partition
beginning at sector 0, this is even somewhat likely.

1) create a sun disklabel w/partitions
2) mkfs the first partition (at sector 0)
3) remove the partition table
4) run blkid - this finds the fs on the whole disk, places in cache
5) recreate the partition table
6) run blkid - this finds the partition, places in cache

And now we have both /dev/sda and /dev/sda1 in cache.

There are heuristics in probe_all to avoid putting the whole disk
in cache if it has partitions, but there is nothing to remove the
whole-disk entry in the above case.  I think the below patch
suffices, although I haven't quite convinced myself that setting
the lens[which]=0; is the right logic for that bit of state...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agomke2fs.8: Clarify in the man page that fs defaults come from mke2fs.conf
Theodore Ts'o [Thu, 23 Apr 2009 02:36:36 +0000 (22:36 -0400)]
mke2fs.8: Clarify in the man page that fs defaults come from mke2fs.conf

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibext2fs: Skip relative pathnames in /etc/mtab in ismounted.c
Theodore Ts'o [Thu, 23 Apr 2009 02:20:22 +0000 (22:20 -0400)]
libext2fs: Skip relative pathnames in /etc/mtab in ismounted.c

The functions which test to see if a device is mounted can get
confused by entries in /etc/mtab for virtual filesystems:

rootfs / rootfs rw 0 0
none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0

If the device name doesn't start with a slash, ignore the /etc/mtab
entry, so that relative pathnames passed into functions such as
ext2fs_check_mount_point() or ext2fs_check_if_mounted() don't return
false positives.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agotune2fs: Fix format string warnings
Theodore Ts'o [Wed, 22 Apr 2009 19:13:37 +0000 (15:13 -0400)]
tune2fs: Fix format string warnings

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agologsave: Fix warn_unused_result warnings from gcc
Theodore Ts'o [Wed, 22 Apr 2009 19:12:40 +0000 (15:12 -0400)]
logsave: Fix warn_unused_result warnings from gcc

Fixed a potential bug where by partial returns from the write(2)
system call could some bytes to be lost when writing to the log file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoresize2fs: Print a warning message if the ftruncate system call fails
Theodore Ts'o [Wed, 22 Apr 2009 19:10:36 +0000 (15:10 -0400)]
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>
15 years agoe2fsck: Fix warn_unused_result warnings from gcc
Theodore Ts'o [Wed, 22 Apr 2009 19:09:41 +0000 (15:09 -0400)]
e2fsck: Fix warn_unused_result warnings from gcc

Fixed a potential bug where by partial returns from the write(2)
system call could lost characters to be sent to external progress bar
display program.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebugfs: Fix format string warnings in htree_dump_leaf_node()
Theodore Ts'o [Wed, 22 Apr 2009 19:08:36 +0000 (15:08 -0400)]
debugfs: Fix format string warnings in htree_dump_leaf_node()

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibext2fs: Fix format string type warnings in alloc_stats.c
Theodore Ts'o [Wed, 22 Apr 2009 19:07:00 +0000 (15:07 -0400)]
libext2fs: Fix format string type warnings in alloc_stats.c

Fix gcc warnings caused by wrong types passed com_err() in
ext2fs_inode_alloc_stats2 and in ext2fs_block_alloc_stats().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibss: Fix warn_unused_result warnings from gcc
Theodore Ts'o [Wed, 22 Apr 2009 18:48:59 +0000 (14:48 -0400)]
libss: Fix warn_unused_result warnings from gcc

Fixed a potential bug where by partial returns from the write system
call could the fallback pager to drop characters.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibss: ss_execute_line: reflect any error codes from system() to the caller
Theodore Ts'o [Wed, 22 Apr 2009 18:46:48 +0000 (14:46 -0400)]
libss: ss_execute_line: reflect any error codes from system() to the caller

This is primarily to silence a gcc warning, but it's better to reflect
the error from system() up to the caller.  In this case we don't
actually use it for anything, but that's OK.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibcom_err: Declare prototypes for et_list_lock/unlock in com_err.h
Theodore Ts'o [Wed, 22 Apr 2009 18:41:32 +0000 (14:41 -0400)]
libcom_err: Declare prototypes for et_list_lock/unlock in com_err.h

Define the prototypes for et_list_lock() and et_list_unlock() in
com_err.h.  This promotes better error checking and avoids warnings
when compiling the library and programs that call these functions.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibe2p: Declare prototypes for the journal feature name functions in e2p.h
Theodore Ts'o [Wed, 22 Apr 2009 18:35:45 +0000 (14:35 -0400)]
libe2p: Declare prototypes for the journal feature name functions in e2p.h

Define the prototypes for e2p_jrnl_feature2string() and
e2p_jrnl_string2feature() in e2p.h.  This promotes better error
checking and avoids warnings when compiling the library and programs
that call these functions.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoconfigure.in: add --disable-libblkid option
Theodore Ts'o [Wed, 22 Apr 2009 13:18:30 +0000 (09:18 -0400)]
configure.in: add --disable-libblkid option

Add an option to switch between the private (in-tree) libblkid and
public (in-system installed) library.  The private version is still
enabled by default.

If --disable-libblkid is specified the findfs(8) program, which is a
variant of tune2fs, is also not built or installed.

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoExplain the significance of the 'T' attribute in the chattr.1 man page
Theodore Ts'o [Wed, 22 Apr 2009 02:18:19 +0000 (22:18 -0400)]
Explain the significance of the 'T' attribute in the chattr.1 man page

Addresses-Debian-Bug: #365619

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agopo: Add Chinese (simplified) translation from the Translation Project
Theodore Ts'o [Wed, 22 Apr 2009 02:09:01 +0000 (22:09 -0400)]
po: Add Chinese (simplified) translation from the Translation Project

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebian: Update debhelper compat level to 7
Theodore Ts'o [Mon, 20 Apr 2009 12:12:15 +0000 (08:12 -0400)]
debian: Update debhelper compat level to 7

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebian: Update copyright files to point the correct common license files
Theodore Ts'o [Mon, 20 Apr 2009 11:49:26 +0000 (07:49 -0400)]
debian: Update copyright files to point the correct common license files

This fixes the Lintian warning:

   The copyright file refers to the versionless symlink in
   /usr/share/common-licenses for the full text of the GPL, LGPL, or GFDL
   license, but the package does not appear to allow distribution under
   later versions of the license. This symlink will change with each
   release of a new version of the license and may therefore point to a
   different version than the package is released under. debian/copyright
   should instead refers to the specific version of the license that the
   package references.

   For example, if the package says something like "you can redistribute it
   and/or modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation; version 2 dated June, 1991,"
   the debian/copyright file should refer to
   /usr/share/common-licenses/GPL-2, not /GPL.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebian: Put the *-dbg packages in the debug section as requested by Lintian
Theodore Ts'o [Mon, 20 Apr 2009 11:46:08 +0000 (07:46 -0400)]
debian: Put the *-dbg packages in the debug section as requested by Lintian

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoInterim commit for Debian release -- 1.41.4-2
Theodore Ts'o [Mon, 20 Apr 2009 03:06:45 +0000 (23:06 -0400)]
Interim commit for Debian release -- 1.41.4-2

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoresize2fs: Fix corruption bug impacting ext4 filesystems with uninit_bg
Theodore Ts'o [Sun, 19 Apr 2009 02:42:13 +0000 (22:42 -0400)]
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>
15 years agoresize2fs: Fix data corruption bug when shrinking the inode table for ext4
Theodore Ts'o [Sun, 19 Apr 2009 02:32:03 +0000 (22:32 -0400)]
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>
15 years agoresize2fs: Fix data corruption bug when growing an ext4 filesystem off-line
Theodore Ts'o [Sat, 18 Apr 2009 17:31:54 +0000 (13:31 -0400)]
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>
15 years agotune2fs: Clarify manpage regarding how to see the current settings
Theodore Ts'o [Sat, 18 Apr 2009 15:39:22 +0000 (11:39 -0400)]
tune2fs: Clarify manpage regarding how to see the current settings

Addresses-Debian-Bug: #515693

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebian: Add homepage field to the control file
Theodore Ts'o [Sat, 18 Apr 2009 15:37:35 +0000 (11:37 -0400)]
debian: Add homepage field to the control file

Addresses-Debian-Bug: #506279

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck, tune2fs: Fix Hurd compilation problem due to lack of PATH_MAX
Theodore Ts'o [Sat, 18 Apr 2009 14:53:32 +0000 (10:53 -0400)]
e2fsck, tune2fs: Fix Hurd compilation problem due to lack of PATH_MAX

Hurd doesn't define PATH_MAX, so calculate the exact size needed for
the tdb filename, and allocate it dynamically.

Addresses-Debian-Bug: #521602

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebugfs: Teach the set_inode_fields_command how to set i_file_acl_high
Theodore Ts'o [Sat, 18 Apr 2009 13:41:04 +0000 (09:41 -0400)]
debugfs: Teach the set_inode_fields_command how to set i_file_acl_high

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebugfs: Print 64-bit file acl
Theodore Ts'o [Sat, 18 Apr 2009 13:40:26 +0000 (09:40 -0400)]
debugfs: Print 64-bit file acl

This is necessary so we can debug filesystem corruptions caused by the
i_file_acl bogusly getting set.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agouuidd: Fix warn_unused_result warnings from gcc
Theodore Ts'o [Sat, 18 Apr 2009 13:14:31 +0000 (09:14 -0400)]
uuidd: Fix warn_unused_result warnings from gcc

Fixed a potential bug caused by partial returns from the write system
call (especially possible for network connections).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibuuid: Close all file descriptors before running uuidd
Theodore Ts'o [Wed, 15 Apr 2009 17:05:09 +0000 (13:05 -0400)]
libuuid: Close all file descriptors before running uuidd

This avoids problems when the calling program has open file
descriptors (especially sockets) open.

Also fix up some warn_unused_result warnings from gcc.

Addresses-Launchpad-bug: #305057

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: print unsigned RAM usage statistics
Andreas Dilger [Tue, 28 Oct 2008 20:44:21 +0000 (14:44 -0600)]
e2fsck: print unsigned RAM usage statistics

Running e2fsck against a 14.5TB filesystem with -tt it reported
-200904kB for RAM usage in pass3 instead of the correct 2300773kB.
The RAM usage statistics were being printed with %d instead of %u.

Also fix a few places using %ld for inode numbers instead of %lu.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: ignore differing NEEDS_RECOVERY flag on backup sbs
Eric Sandeen [Sat, 22 Nov 2008 15:02:48 +0000 (09:02 -0600)]
e2fsck: ignore differing NEEDS_RECOVERY flag on backup sbs

When we resize online, the primary superblock gets copied to all
the backups, and of course since we're mounted the NEEDS_RECOVERY
flag is set.  A subsequent fsck will find the backups have the
NEEDS_RECOVERY flag set while the primary does not, and this
forces a full fsck pass.

I think this flag can be safely ignored in the flag comparisons.

Addresses-Red-Hat-Bugzilla: #471925

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agomke2fs: Don't try to create the journal in super-only mode
Theodore Ts'o [Tue, 31 Mar 2009 11:42:24 +0000 (07:42 -0400)]
mke2fs: Don't try to create the journal in super-only mode

Since we aren't initializing the inode table, creating the journal
will just fail.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Tue, 17 Mar 2009 02:26:52 +0000 (22:26 -0400)]
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agolibext2fs: external journal devices should not cause ext2fs_open2 to fail
Theodore Ts'o [Tue, 17 Mar 2009 02:16:44 +0000 (22:16 -0400)]
libext2fs: external journal devices should not cause ext2fs_open2 to fail

This fixes a regression introduced in commit 79a9ab14 which caused
attempts to open external journals to fail due to overly strict
filesystem consistency checks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebugfs: Fix typos in logdump's error messages
Manish Katiyar [Sun, 8 Mar 2009 18:15:31 +0000 (23:45 +0530)]
debugfs: Fix typos in logdump's error messages

Below patch fixes some trivial typos found during code reading

Signed-off-by : Manish Katiyar <mkatiyar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agolibss: Avoid leak upon failed realloc in ss_add_request_table()
Jim Meyering [Mon, 23 Feb 2009 17:26:05 +0000 (18:26 +0100)]
libss: Avoid leak upon failed realloc in ss_add_request_table()

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agolibext2fs: don't leak strdup'd dev name in dosio.c upon error
Jim Meyering [Mon, 23 Feb 2009 16:47:30 +0000 (17:47 +0100)]
libext2fs: don't leak strdup'd dev name in dosio.c upon error

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoremove useless if-before-free tests
Jim Meyering [Mon, 23 Feb 2009 17:07:50 +0000 (18:07 +0100)]
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>
15 years agofix libext2fs info page name
Eric Sandeen [Thu, 29 Jan 2009 22:52:13 +0000 (17:52 -0500)]
fix libext2fs info page name

In Red Hat bug #481620 Jerry reported that the libext2fs info page
is not accesable via "info libext2fs" but is via "info libext2fs.info"
and suggested that the following change should fix it.

Additional info from Jerry:
The problem is that makeinfo 4.12 interprets the dot in "libext2fs.info"
to be the end of the description portion of the info entry, even though
it hasn't seen the closing parenthesis yet.  Making the reference be to
just "libext2fs" works.

Addresses-Red-Hat-Bugzilla: #481620

Reported-by: Jerry James <loganjerry@gmail.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agodebugfs: fix segfault on "stat" command with no open fs
Eric Sandeen [Thu, 29 Jan 2009 22:46:28 +0000 (17:46 -0500)]
debugfs: fix segfault on "stat" command with no open fs

This is a regression from commit
8fdf29117f922419bd5b3f741e5d554b1d5b8893, which attempts to access
current_fs via a feature check before we check that it's open.

Just moving the feature check below the open check should fix it.

Reported-by: Andrew Hecox <ahecox@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agotests: Filter out "Lifetime writes" from the dumpe2fs display
Theodore Ts'o [Sun, 8 Mar 2009 23:01:03 +0000 (19:01 -0400)]
tests: Filter out "Lifetime writes" from the dumpe2fs display

The Lifetime writes field will probably not be stable as we add new
features to e2fsprogs, so filter it out to avoid spurious test failures.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoblkid: Add fallback to ext4 for 2.6.29+ kernels if ext2 is not present
Theodore Ts'o [Sun, 8 Mar 2009 22:56:41 +0000 (18:56 -0400)]
blkid: Add fallback to ext4 for 2.6.29+ kernels if ext2 is not present

Starting in 2.6.29, ext4 can be used to support filesystems without a
journal.  So if ext2 is not present, and the kernel version is greater
than 2.6.29, and ext4 is present, return a filesystme type of ext4.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoblkid: recognize ext4(dev) without journal
Eric Sandeen [Wed, 25 Feb 2009 05:17:54 +0000 (23:17 -0600)]
blkid: recognize ext4(dev) without journal

ext4/ext4dev no longer require a journal.

w/o this blkid doesn't recognize after:

# mkfs.ext4 /dev/blah
# tune2fs -O ^has_journal
# blkid /dev/blah

We still must have one ext3-incompat-feature to flag
as ext4(dev) so we shouldn't ever mis-recognize it.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoe2fsprogs: blkid.static make target
Eric Sandeen [Wed, 25 Feb 2009 05:15:33 +0000 (23:15 -0600)]
e2fsprogs: blkid.static make target

Nice for testing w/o needing to swizzle around system
libraries...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoe2fsprogs: fix potential null ptr defef in check_for_modules()
Eric Sandeen [Tue, 24 Feb 2009 21:13:39 +0000 (15:13 -0600)]
e2fsprogs: fix potential null ptr defef in check_for_modules()

The coverity scanner found this one.

If a line in modules.dep has a ":" but no "/" then:

                if ((cp = strchr(buf, ':')) != NULL)
                        *cp = 0;
                else
                        continue;
                if ((cp = strrchr(buf, '/')) != NULL)
                        cp++;
                /* XXX else cp is still null */
                i = strlen(cp);

... we will deref a null pointer (cp).  This can be
demonstrated by putting a line like:

foo.ko:

into modules.dep.  The below change just says that if no "/" is
found, treat the whole string as the module name.

Addresses-Red-Hat-Bugzilla: #486997

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agomke2fs, tune2fs: Do not allow the reserved_ratio to be negative
Theodore Ts'o [Fri, 6 Mar 2009 07:23:59 +0000 (02:23 -0500)]
mke2fs, tune2fs: Do not allow the reserved_ratio to be negative

Add a check to make sure the argument to the -m option (which
specifies the reserved ratio) is greater than zero.

Addresses-Debian-Bug: #517015

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoAdd support for a new superblock field: s_kbytes_written
Theodore Ts'o [Fri, 6 Mar 2009 00:40:20 +0000 (19:40 -0500)]
Add support for a new superblock field: s_kbytes_written

This field tracks the lifetime amount of writes to the filesystem.  It
will be updated by the kernel as well as by e2fsprogs programs which
write to the filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUpdate release notes, changelog, etc., for e2fsprogs 1.41.4 release
Theodore Ts'o [Wed, 28 Jan 2009 00:51:00 +0000 (19:51 -0500)]
Update release notes, changelog, etc., for e2fsprogs 1.41.4 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUpdate e2fsprogs translation template.
Theodore Ts'o [Tue, 27 Jan 2009 01:43:10 +0000 (20:43 -0500)]
Update e2fsprogs translation template.

15 years agoe2fsck: Add missing newlines when reporting errors in pass 3A
Theodore Ts'o [Mon, 26 Jan 2009 21:41:46 +0000 (16:41 -0500)]
e2fsck: Add missing newlines when reporting errors in pass 3A

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Change PR_3_CREATE_LPF_ERROR to be a non-fatal problem
Theodore Ts'o [Thu, 22 Jan 2009 21:05:29 +0000 (16:05 -0500)]
e2fsck: Change PR_3_CREATE_LPF_ERROR to be a non-fatal problem

The other problem codes associated with failing to create the
lost+found directory are non-fatal, and this one should be non-fatal
as well.  The two places which call e2fsck_get_lost_and_found()
already deal with a failure to create the directory, so there's no
point making this be a fatal error.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibext2fs: Add sanity checks to ext2fs_{block,inode}_alloc_stats
Theodore Ts'o [Thu, 22 Jan 2009 21:01:38 +0000 (16:01 -0500)]
libext2fs: Add sanity checks to ext2fs_{block,inode}_alloc_stats

If ext2fs_inode_alloc_stats2() or ext2fs_block_alloc_stats() is passed
an insanely large inode or block number, it's possible for these
functions to overrun an array boundary and cause the calling program
to crash with a memory error.

Detect this case, and since these functions don't return an error
code, print a warning message, much like we do in ext2fs_warn_bitmap2().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoext2fs_new_inode(): Add sanity check to assure a valid inode number
Theodore Ts'o [Thu, 22 Jan 2009 20:55:49 +0000 (15:55 -0500)]
ext2fs_new_inode(): Add sanity check to assure a valid inode number

Add a sanity check to makesure that even if the superblock field
s_first_inode is insane, that we won't return an invalid inode number.
(The function will return the error EXT2_ET_INODE_ALLOC_FAIL in that
case.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Add superblock check to make sure s_first_ino is valid
Theodore Ts'o [Thu, 22 Jan 2009 20:52:50 +0000 (15:52 -0500)]
e2fsck: Add superblock check to make sure s_first_ino is valid

An deliberately corrupted filesystem with an insanely large
s_first_ino field could cause e2fsck to crash with a seg fault.

Thanks to Eric Sesterhenn for supplying test cases which demonstrated
this issue.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agomke2fs: If the device size is exactly 16TB treat it as if it had 16TB - 1 block
Theodore Ts'o [Tue, 20 Jan 2009 19:03:03 +0000 (14:03 -0500)]
mke2fs: If the device size is exactly 16TB treat it as if it had 16TB - 1 block

This allows users who create a 16TB LVM to have mke2fs do (mostly) the
right thing automatcally.

15 years agoext2fs_get_device_size: Fix error handling
Theodore Ts'o [Tue, 20 Jan 2009 18:37:47 +0000 (13:37 -0500)]
ext2fs_get_device_size: Fix error handling

The previous patch would return EFBIG for any failure called from
ext2fs_get_device_size2().  (I didn't merge this fix with the
preceeding commit to allow merges to happen more easily.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoAdd 64-bit getsize interface.
Jose R. Santos [Wed, 20 Aug 2008 17:34:07 +0000 (12:34 -0500)]
Add 64-bit getsize interface.

Added interface capable of opening 64-bit block device.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agomke2fs: Add -U option to specify the UUID for the new filesystem
Theodore Ts'o [Tue, 20 Jan 2009 18:18:23 +0000 (13:18 -0500)]
mke2fs: Add -U option to specify the UUID for the new filesystem

Patch integrated from Mandriva

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoUse format strings directly to prevent -Werror=format-security failures
Theodore Ts'o [Tue, 20 Jan 2009 18:05:25 +0000 (13:05 -0500)]
Use format strings directly to prevent -Werror=format-security failures

Gcc is too stupid to realize that:

    const char *usage="String which has no percent signs";

    com_err(progname, 0, usage);

is OK.  I refuse to bow to stupidity with:

   com_err(progname, 0, "%s", usage);

but I will use the string directly for the sake of people who like to
build with -Werror=format-security.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoblkid: Add support for detecting user-level suspend as a swsuspend signature
Theodore Ts'o [Tue, 20 Jan 2009 17:07:31 +0000 (12:07 -0500)]
blkid: Add support for detecting user-level suspend as a swsuspend signature

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agomke2fs: Treat an argv[0] of "mke3fs" the same as "mkfs.ext3"
Theodore Ts'o [Tue, 20 Jan 2009 17:02:40 +0000 (12:02 -0500)]
mke2fs: Treat an argv[0] of "mke3fs" the same as "mkfs.ext3"

Mandriva apparently uses "mke3fs" as an alias for mkfs.ext3.  I'm not
particularly fond of that practice, but we'll include it as legacy
support.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agotune2fs: Fix tune2fs -I so it won't corrupt RAID filesystems
Theodore Ts'o [Tue, 20 Jan 2009 16:49:17 +0000 (11:49 -0500)]
tune2fs: Fix tune2fs -I so it won't corrupt RAID filesystems

If a filesystem is built with the stride extended-option (which is
often used in RAID filesystems to make sure the block and inode
allocation bitmaps don't end up hitting one disk platter harder than
the rest), this can cause tune2fs -I to corrupt the filesystem because
it fails to handle the case where the allocation bitmaps are located
after the inode table, where the inode table needs to grow.  Handle
this case correctly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agotune2fs: General (whitespace) cleanup
Theodore Ts'o [Tue, 20 Jan 2009 07:34:39 +0000 (02:34 -0500)]
tune2fs: General (whitespace) cleanup

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agotune2fs: Don't allow the -I option if the flex_bg feature is enabled
Theodore Ts'o [Tue, 20 Jan 2009 06:50:07 +0000 (01:50 -0500)]
tune2fs: Don't allow the -I option if the flex_bg feature is enabled

With flex_bg usually the inode table for most block groups are packed
right against each other, so expanding the inode table size needs
special handling that's not currently in tune2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoblkid: recognize btrfs
Eric Sandeen [Thu, 8 Jan 2009 21:08:16 +0000 (15:08 -0600)]
blkid: recognize btrfs

Add btrfs detection to libblkid, now that the disk format should be
recognizable in the future.

# misc/blkid /tmp/fsfile
/tmp/fsfile: LABEL="mylabel" UUID="102b07f0-0e79-4b42-8a4e-1dde418bbe6d" TYPE="btrfs"

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agodebian: Add "set -e" to uuid-runtime's prerm script
Theodore Ts'o [Tue, 20 Jan 2009 05:55:32 +0000 (00:55 -0500)]
debian: Add "set -e" to uuid-runtime's prerm script

This addresses a Lintian warning.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoresize2fs: Reserve some extra space for -P/-M for ext4 filesystems
Theodore Ts'o [Tue, 20 Jan 2009 05:46:06 +0000 (00:46 -0500)]
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>
15 years agoext2fs_open2: Add more checks for filesystem consistency
Thiemo Nagel [Tue, 20 Jan 2009 04:16:10 +0000 (23:16 -0500)]
ext2fs_open2: Add more checks for filesystem consistency

Add more checks to assure the filesystem is sane to avoid later
division by zero errors.

Patch adds consistency checks on superblock to fix serveral crashes:
* require EXT2_INODES_PER_GROUP != 0
* require EXT2_DESC_PER_BLOCK != 0
* require s_first_data_block < s_blocks_count
* require group_desc_count * EXT2_INODES_PER_GROUP == s_inodes_count

Signed-off-by: Thiemo Nagel <thiemo.nagel@ph.tum.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoext2fs_read_inode_full: Add safety check to avoid SEGV's on corrupted fs's
Theodore Ts'o [Tue, 20 Jan 2009 04:09:37 +0000 (23:09 -0500)]
ext2fs_read_inode_full: Add safety check to avoid SEGV's on corrupted fs's

Thanks to Thiemo Nagel for suggesting this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agodebian: Add mkfs.ext4 symlink to the e2fsprogs-udeb package
Theodore Ts'o [Tue, 20 Jan 2009 02:05:49 +0000 (21:05 -0500)]
debian: Add mkfs.ext4 symlink to the e2fsprogs-udeb package

This patch is needed for Ubuntu Januty.

Addresses-Debian-Bug: #511207

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoext2fs_block_iterate2: Preserve the uninit flag in extents
Theodore Ts'o [Tue, 20 Jan 2009 00:30:59 +0000 (19:30 -0500)]
ext2fs_block_iterate2: Preserve the uninit flag in extents

When modifying a block via the block_iterate interface, preserve the
uninit flag in the extent.  Resize2fs uses this interface, so we have
to preserve the uninit status when relocating a block.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoext2fs_block_iterate2: Reflect errors from ext2fs_extent_set_bmap to caller
Theodore Ts'o [Mon, 19 Jan 2009 19:22:52 +0000 (14:22 -0500)]
ext2fs_block_iterate2: Reflect errors from ext2fs_extent_set_bmap to caller

If the callback function tries to change a block, and
ext2fs_extent_set_bmap() fails for some reason (for example, there
isn't enough disk space to split a node and expand the extent tree,
make sure that error is reflected back up to the caller.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoresize2fs: Release bitmap and itable blocks in flex_bg filesystems
Theodore Ts'o [Mon, 19 Jan 2009 14:02:55 +0000 (09:02 -0500)]
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>
15 years agoresize2fs: Move all required blocks for ext4 filesystems
Theodore Ts'o [Mon, 19 Jan 2009 13:43:36 +0000 (08:43 -0500)]
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>
15 years agodebugfs: Fix logdump command for 32-bit filesystems
Theodore Ts'o [Mon, 19 Jan 2009 03:48:16 +0000 (22:48 -0500)]
debugfs: Fix logdump command for 32-bit filesystems

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Fix journal replay for block sizes greater than 8k
Theodore Ts'o [Fri, 2 Jan 2009 23:14:42 +0000 (18:14 -0500)]
e2fsck: Fix journal replay for block sizes greater than 8k

E2fsck was using a fixed-size 8k buffer for replaying blocks from the
journal.  So attempts to replay a journal on filesystems greater than
8k would cause e2fsck to crash with a segfault.

Thanks to Miao Xie <miaox@cn.fujitsu.com> for reporting this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Remove "ext3" from problem descriptions of the journal
Theodore Ts'o [Fri, 2 Jan 2009 04:10:40 +0000 (23:10 -0500)]
e2fsck: Remove "ext3" from problem descriptions of the journal

The ext4 filesystem uses journals too, so remove "ext3" from the
problem descriptions involving journals.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoAdd e2fsck regression test case f_extent_bad_node
Theodore Ts'o [Fri, 26 Dec 2008 03:47:03 +0000 (22:47 -0500)]
Add e2fsck regression test case f_extent_bad_node

This test case is designed to test e2fsck's ability to deal with a
corrupted interior node in an extent tree.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Fix an unhandled corruption case in scan_extent_node()
Theodore Ts'o [Fri, 26 Dec 2008 03:42:38 +0000 (22:42 -0500)]
e2fsck: Fix an unhandled corruption case in scan_extent_node()

A corrupted interior node in an extent tree would cause e2fsck to
crash with the error message:

Error1: Corrupt extent header on inode 107192
Aborted (core dumped)

Handle this and related failures when scanning an inode's extent tree
more robustly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: When repacking directories, leave slack space for more efficiency
Theodore Ts'o [Wed, 24 Dec 2008 00:10:43 +0000 (19:10 -0500)]
e2fsck: When repacking directories, leave slack space for more efficiency

If the directory is packed with no slack space, as soon as any new
directory entries are added, leaf nodes end up getting split and
directory ends up getting very inefficient.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Fix double-counting of non-contiguous extent-based inodes
Theodore Ts'o [Tue, 9 Dec 2008 03:58:29 +0000 (22:58 -0500)]
e2fsck: Fix double-counting of non-contiguous extent-based inodes

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Enhance fragcheck report with file/directory information
Theodore Ts'o [Tue, 9 Dec 2008 03:00:13 +0000 (22:00 -0500)]
e2fsck: Enhance fragcheck report with file/directory information

Report whether a fragmented inode is a directory or a file, as this is
highly useful for determining what is going on with an ext4 filesystem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: In verbose mode, distinguish between fragmented directories/files
Theodore Ts'o [Tue, 9 Dec 2008 02:33:11 +0000 (21:33 -0500)]
e2fsck: In verbose mode, distinguish between fragmented directories/files

Track the number of non-contiguous files and directories so we can
give more detailed information in verbose mode.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoe2fsck: Don't cancel the fsck run after clearing an errant INODE_UNINIT flag
Theodore Ts'o [Thu, 27 Nov 2008 01:41:26 +0000 (20:41 -0500)]
e2fsck: Don't cancel the fsck run after clearing an errant INODE_UNINIT flag

Thanks to Kelly Kane from Dreamhost for reporting this bug and then
helping us find and fix it.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
16 years agoAdd make-sparse.c to contrib
Theodore Ts'o [Mon, 17 Nov 2008 22:52:15 +0000 (17:52 -0500)]
Add make-sparse.c to contrib

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
16 years agodebian: Fix mkinitfs on x86_64 systems
Theodore Ts'o [Sun, 16 Nov 2008 15:35:41 +0000 (10:35 -0500)]
debian: Fix mkinitfs on x86_64 systems

On x86_64 systems, we need to filter out linux-vdso.so lines from the
output of the ldd program when determining the library dependencies.

Addresses-Debian-Bug: #503057

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
16 years agoFix various signed/unsigned gcc warnings
Theodore Ts'o [Sun, 16 Nov 2008 15:03:00 +0000 (10:03 -0500)]
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>
16 years agopo: update ca.po (from translationproject.org)
David Planella [Sat, 15 Nov 2008 20:07:39 +0000 (15:07 -0500)]
po: update ca.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
16 years agodumpe2fs: Only print inline journal information if the journal is internal
Theodore Ts'o [Sat, 15 Nov 2008 20:05:51 +0000 (15:05 -0500)]
dumpe2fs: Only print inline journal information if the journal is internal

Currently dumpe2fs displays an error if run on a filesystem with an
external journal.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
16 years agoAdd support to build profiled binaries in the misc directory
Theodore Ts'o [Sat, 15 Nov 2008 17:34:28 +0000 (12:34 -0500)]
Add support to build profiled binaries in the misc directory

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
16 years agoe2fsck: Fix build of e2fsck.profiled if profiling is enabled
Theodore Ts'o [Sat, 15 Nov 2008 17:12:57 +0000 (12:12 -0500)]
e2fsck: Fix build of e2fsck.profiled if profiling is enabled

It's been a while since I've done a build using "configure
--enable-profile", and some bitrot had set into the Makefiles...

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