Commit Graph

3253 Commits (cd65a24e756b8f6770a5961fd94c67eb00dd7baa)

Author SHA1 Message Date
Theodore Ts'o cd65a24e75 libext2fs: Convert ext2fs_bg_flag_test() to ext2fs_bg_flags_test()
After cleaning up ext2fs_bg_flag_set() and ext2fs_bg_flag_clear(),
we're left with ext2fs_bg_flag_test().  Convert it to
ext2fs_bg_flags_test().

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

Currently we have this:

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

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

and these, which can twiddle individual bits in bg_flags:

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

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

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

and remove the original ext2fs_bg_flags_set / ext2fs_bg_flags_clear.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-25 21:41:32 -04:00
Eric Sandeen 03b9dca63a 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>
2009-10-25 21:41:13 -04:00
Theodore Ts'o 72a729dbf9 Merge branch 'maint' into next
Conflicts:
	configure
	configure.in
2009-10-24 15:14:54 -04:00
Theodore Ts'o 06807d9fa6 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>
2009-10-24 15:04:54 -04:00
Michael Roth ca3b06e700 Update .gitignore
Signed-off-by: Michael Roth <mroth@nessie.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-10-24 14:28:23 -04:00
Theodore Ts'o c5fbf38855 tune2fs.8: Clarify tune2fs's -i option
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-24 14:25:39 -04:00
Theodore Ts'o 77f464fb19 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>
2009-10-24 14:15:55 -04:00
Eric Sandeen beb736b4c4 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>
2009-10-21 03:43:02 -04:00
Theodore Ts'o 5d10807070 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>
2009-10-21 01:46:58 -04:00
Theodore Ts'o ba5131f6d4 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>
2009-10-16 20:59:20 -04:00
Theodore Ts'o 8a8f36540b 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>
2009-10-12 21:59:37 -04:00
Theodore Ts'o 95bcea9fc1 Merge branch 'maint' into next
Conflicts:
	configure
	configure.in
	misc/mke2fs.c
2009-10-04 20:40:46 -04:00
Theodore Ts'o 695706ca21 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>
2009-10-04 18:02:24 -04:00
Theodore Ts'o f790bc33b2 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>
2009-10-04 16:29:17 -04:00
Theodore Ts'o a321afa8b7 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>
2009-10-04 16:21:13 -04:00
Eric Sandeen 9ed8e5fec2 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>
2009-10-04 15:09:18 -04:00
Theodore Ts'o e1f0850795 Don't use in-tree header files if using system uuid or blkid libraries
This commit forces the use of the system-provided blkid or uuid header
files if we are using the system-provided blkid or uuid libraries.
This avoids using the in-tree header files with the system libraries.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-04 14:45:08 -04:00
Theodore Ts'o 61a9d2b33e e2fsck: Use the correct problem code in the case of LAST_WRITE_FUDGED
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-03 23:17:45 -04:00
Theodore Ts'o 7822f784f1 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>
2009-10-03 22:33:47 -04:00
Peng Tao 2d7ef236b7 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>
2009-10-03 22:30:37 -04:00
Cristian Rodríguez 484ddc8767 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>
2009-10-03 13:38:47 -04:00
Theodore Ts'o 04f13d6685 libext2fs: Add error table initialization to test programs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-08 21:33:03 -04:00
Theodore Ts'o 1d4a493fa2 e2undo: Initialize com_err error tables for the ext2fs library
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-08 21:29:21 -04:00
Valerie Aurora Henson 048786d7e8 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>
2009-09-07 22:46:17 -04:00
Valerie Aurora Henson 4efbac6fed Convert uses of super->s_*_blocks_count to ext2fs_*_blocks_count()
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07 20:46:34 -04:00
Valerie Aurora Henson a63745e81c Use ext2fs_file_acl_block() instead of using .i_file_acl directly
This provides support for 48-bit file acl blocks.

Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07 22:29:45 -04:00
Valerie Aurora Henson c5b7b6babe 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>
2009-09-07 21:23:03 -04:00
Theodore Ts'o 51e6459491 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>
2009-09-07 16:21:49 -04:00
Theodore Ts'o 7a9f055f0e 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>
2009-09-07 16:21:32 -04:00
Theodore Ts'o 73ebdf9972 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>
2009-09-07 16:21:32 -04:00
Peng Tao 2884d208a3 resize2fs: fix minimum resize size calculation with flex_bg
When flex_bg is on, calculate_minimum_resize_size() should add more meta
blocks for newly added flex_bg.

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

Signed-off-by: "Peng Tao" <bergwolf@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-09-07 14:20:52 -04:00
Theodore Ts'o 0b5b9f90ee 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>
2009-09-06 21:28:47 -04:00
Theodore Ts'o 1d9b818317 dumpe2fs: Print more information about the inline journal
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-06 18:55:09 -04:00
Theodore Ts'o 1be2ce0f49 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>
2009-09-01 20:27:29 -04:00
Theodore Ts'o 82b59ca1ed 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>
2009-09-01 20:01:38 -04:00
Karel Zak 249c962ad8 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>
2009-08-27 20:58:54 -04:00
Theodore Ts'o 8bafedbf4a 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>
2009-08-25 10:07:16 -04:00
Valerie Aurora Henson 95fd65bb7f 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>
2009-08-23 19:20:03 -04:00
Theodore Ts'o 732c8cd58f Use accessor functions fields for bg_flags in the block group descriptors
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07 21:15:12 -04:00
Valerie Aurora Henson 24a117abd0 Convert to use io_channel_read_blk64() and io_channel_write_blk64()
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07 21:14:24 -04:00
Nick Dokos d62d218f11 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>
2009-09-07 21:13:59 -04:00
Theodore Ts'o dc615a21c3 Merge branch 'maint' into next 2009-09-07 17:02:35 -04:00
Kyle McMartin a9e55a1191 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>
2009-09-07 17:00:33 -04:00
Theodore Ts'o c1b875979f 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>
2009-08-23 22:34:28 -04:00
Theodore Ts'o 31b5a2b961 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>
2009-08-23 15:06:48 -04:00
Theodore Ts'o 686c4c124f Fix debian packaging to work correctly on post-Lenny systems
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-23 10:27:24 -04:00
Theodore Ts'o ffd8078297 e2freefrag: Update manpage to include e2fsprogs version and release date
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22 23:41:49 -04:00
Theodore Ts'o edde3e5142 Update release notes, version string, etc. for E2fsprogs 1.41.9 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-22 23:04:33 -04:00