Commit Graph

3446 Commits (0358c9f9a43ce0ef33f7891ca9f9d67abd3b4853)

Author SHA1 Message Date
Theodore Ts'o 0358c9f9a4 Merge branch 'maint' into next
Conflicts:
	e2fsck/pass4.c
	misc/dumpe2fs.c
	resize/online.c
2010-12-13 09:16:09 -05:00
Theodore Ts'o d085f61f25 Update Release Notes, Changelogs, version.h, etc. for 1.41.13 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-12-13 08:57:14 -05:00
Bernd Schubert 71873b1730 e2fsck: add an option which causes it to only do a journal replay
As recently discussed on linux-ext4@vger.kernel.org add an option to e2fsck
to allow to replay the journal only. That will allow scripts, such as
pacemakers 'Filesystem' RA to first replay the journal and if that sets
an error state from the journal replay, further check for that error
(dumpe2fh -h | grep "Filesystem state:") and if that shows and error
to refuse to mount. It also allows automatic e2fsck scripts to first
replay the journal and on a second run after the real pass1 to passX checks
to test for the return code.

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-12-06 17:15:55 -05:00
Theodore Ts'o b95ca92811 e2fsck: Do blkid interpretation on the external journal specifier
If the user specifies "e2fsck -j UUID=XXX", e2fsck should do blkid
interpretation, since e2fsck does it with the base file system name.
So from the sake of consistency and user convenience, we should do it
here too.

Addresses-Debian-Bug: #559315

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-12-06 17:07:27 -05:00
Theodore Ts'o 7599038836 e2fsck: Add the ability to force a problem to not be fixed
The boolean options "force_no" in the problems stanza of e2fsck.conf
allows a particular problem code be treated as if the user will answer
"no" to the question of whether a particular problem should be fixed
--- even if e2fsck is run with the -y option.

As an example use case, suppose a distribution had widely deployed a
version of the kernel where under some circumstances, the EOFBLOCKS_FL
flag would be left set even though it should not be left set, and a
customer had a workload which exercised the fencepost error all the
time, resulting in many large number of inodes that had EOFBLOCKS_FL
set erroneously.  Enough, in fact, the e2fsck runs were taking too
long.  (There was such a bug in the kernel, which was fixed by commit
58590b06d in 2.6.36).

Leaving EOFBLOCKS_FL set when it should not be isn't a huge deal, and
is certainly than having high availability timeout alerts going off
left and right.  So in this case, the best fix might be to put the
following in /etc/e2fsck.conf:

[problems]
0x010060 = {			# PR_1_EOFBLOCKS_FL_SET
	 force_no = true
	 no_ok = true
	 no_nomsg = true
}

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-12-06 10:10:33 -05:00
Andreas Dilger 0e2afdbacc dumpe2fs: fix output for flex_bg bitmap offsets
When running dumpe2fs on a filesystem formatted with flex_bg, it
prints out the relative offsets for the bitmaps and inode table
badly on 64-bit systems, because the offset is computed as a
large positive number instead of being a negative numer (which
will not be printed at all):

Group 1: (Blocks 0x8000-0xffff) [INODE_UNINIT, ITABLE_ZEROED]
 Block bitmap at 0x0102 (+4294934786), Inode bitmap at 0x0202 (+4294935042)
 Inode table at 0x037e-0x03fa (+4294935422)

This commit prints out the relative offsets for flex_bg
groups as the offset within the reported group.  This makes it
more clear where the metadata is located, rather than simply
printing some large negative number.

Group 1: (Blocks 0x8000-0xffff) [INODE_UNINIT, ITABLE_ZEROED]
 Block bitmap at 0x0102 (bg #0 +258), Inode bitmap at 0x0202 (bg #0 +514)
 Inode table at 0x037e-0x03fa (bg #0 +894)

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-12-05 22:20:19 -05:00
Theodore Ts'o 5a2db04637 mke2fs: Fix (minor) memory leaks
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-12-01 18:49:26 -05:00
Theodore Ts'o 2ee4544d07 mke2fs: Fail if the requested file system type is not defined in mke2fs.conf
If the user passes a file system type which is not defined in
mke2fs.conf (i.e., mke2fs -t xfs ...) change mke2fs so that it prints
a warning and aborts the run.  (There is an exception for ext2, since
that file system does not need a special definition in the fs_types
section of the /etc/mke2fs.conf file.)

In addition, print a warning if there are usage types (specified using
the -T option) which are not defined in /etc/mke2fs.conf.

Addresses-Debian-Bug: #594609

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-12-01 18:28:35 -05:00
Theodore Ts'o 1df56561b6 resize2fs: Clarify error explaining on-line shrinking is not supported at all
Addresses-Debian-Bug: #599786

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-26 19:42:15 -05:00
Theodore Ts'o 230709ae7e resize2fs.8.in: Document that resize2fs -p only works on offline resizes
Addresses-Launchpad-Bug: #505719

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-26 19:35:30 -05:00
Theodore Ts'o 5f70f2e647 MCONFIG: Fix dependency definitions for the static and profiled blkid library
The dependency definitions for DEPSTATIC_LIBBLKID and
DEPPROFILED_LIBBLKID incorrectly referenced the non-dependency macros
(i.e., STATIC_LIBUUID instead of DEPSTATIC_LIBUUID).  This resulted in
-luuid showing up as a Makefile dependency, which is of course wrong.

Addresses-Debian-Bug: #604629

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-26 19:35:10 -05:00
Theodore Ts'o 992016c5af e2fsck: Fix inode nlink accounting that could cause PROGRAMMING BUG errors
This fixes two possible causes for the error message:

WARNING: PROGRAMMING BUG IN E2FSCK!
        OR SOME BONEHEAD (YOU) IS CHECKING A MOUNTED (LIVE) FILESYSTEM.
inode_link_info[X] is Y, inode.i_links_count is Z.  They should be the same!

One cause which can trigger this message is when an inode has an
illegal link count > 65500 --- for example, 65535.  This was the case
in the Debian Bug report #555456.

Another cause which could trigger this message is if an ext4 directory
previously had more than 65000 subdirectories (thus causing
i_link_count to be set to 1), but then some of the subdirectories were
deleted, such that i_link_count should now be the actual number of
subdirectories.

Addresses-Debian-Bug: #555456

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-26 19:09:43 -05:00
Theodore Ts'o 6a81b40ae7 e2fsck.conf.5: Clarify man page
Clarify the e2fsck.conf(5) man page to make it clear that it applies
for ext4 file systems.

Addresses-Debian-Bug: #591083

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-26 18:07:32 -05:00
Theodore Ts'o d5b8a1e907 Update Release Notes, Changelogs, version.h, etc. for 1.41.13 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-22 16:16:05 -05:00
Theodore Ts'o e994dc99fe Disable lazy inode table initialization when running regression tests
This avoids test failures when running on new kernels that allow lazy
itable initialization.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-22 16:16:05 -05:00
Lukas Czerner 7fe5ff3c1e mke2fs: Add discard option into mke2fs.conf
Allow to specify discard in mke2fs.conf. Also change the way how to
specify default value for lazy_itable_init. It is better to have all
this defaulting done in the same place so do it in definition (as we do
with discard).

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-22 16:15:16 -05:00
Lukas Czerner 0bc85dfb38 mke2fs: Deprecate -K option, introduce discard/nodiscard
It would be nice to have consistent "discard" options in every system
tool (mount, fsck, mkfs) taking advantage of discards. Also "discard"
and "nodiscard" is more descriptive instead of just "-K" and can be
easily defaulted and it is something we can not do with "-K".

With this commit you need to specify extended option like this:

./mke2fs -T <fstype> -E nodiscard <device>

in order make a filesystem without discarding the device first. And

./mke2fs -T <fstype> -E discard <device>

respectively.

-K option is with this commit deprecated and should not be used anymore.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-22 13:00:11 -05:00
Theodore Ts'o 2b21a0d9b6 mke2fs: Force the default blocksize to be at least the logical sector size
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-22 11:14:35 -05:00
Theodore Ts'o 92eb5a3392 mke2fs: Set logical/physical sector size from environment for debugging
If MKE2FS_DEVICE_SECTSIZE is set, then this will override the logical
sector size, which is the smallest sector size that can be written
atomically by the device.  (Previously MKE2FS_DEVICE_SECTSIZE set the
physical sector size, which was incorrect given its historical usage.)
The environment variable MKE2FS_DEVICE_PHYS_SECTSIZE will set the
physical sector size, which is the actual sector size used by the
device in reality.

The logical sector size is always less than or equal to the physical
sector size; and writes smaller than the physical sector size but
greather than or equal to the logical sector size will cause a
read-modify-write cycle within the device firmware (or in some
abstract layer lower than the Linux block I/O subsystem, at any rate).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-22 11:09:00 -05:00
Theodore Ts'o 1599b470fb mke2fs: Fill in min_io and opt_io with physical sector size
If the device does not have an explicitly specified minimum io_size or
optimal io_size, and the physical sector size is greater than the
block size, then use the physical sector size as a better-than-nothing
hint.

This should help for SSD's that have a physical sector size of 8k or
16k (which are reportedly will be coming soon).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-22 10:50:42 -05:00
Theodore Ts'o f89f54aff4 mke2fs: Do not require -F for block size < physical size
There will be SSD's out soon that have 8k or 16k phyiscal block sizes.
So don't enforce a requirement that the block size be less than the
physical block size unless the force option is given, and don't give a
warning if the user can't do anything about it (i.e., if the physical
block size is > than the page size).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-22 09:22:05 -05:00
Theodore Ts'o 210fd2c707 mke2fs: Enable lazy_itable_init if the kernel supports this feature
Add check for /sys/fs/ext4/features/lazy_itable_init.  If this file
exists, it should be OK to skip initializing the inode table since the
kernel will do it at mount time.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-10-01 10:47:38 -04:00
Theodore Ts'o 9946478a23 tune2fs.8: Document that the device can be specified via LABEL= or UUID=
Addresses-Debian-Bug: #580236

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-25 21:41:21 -04:00
Theodore Ts'o 8718359b40 e2fsck: Open the external journal in exclusive mode
This prevents accidentally replaying and resetting the journal while
it is mounted, due to an accidental attempt to run e2fsck on an LVM
snapshot of a file system with an external journal.

Addresses-Debian-Bug: #587531

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-25 21:14:06 -04:00
Theodore Ts'o 63feaa13ab resize2fs.8: Make it clear that power-of-2 units are meant by kilobytes
It's sad that this needs to be made clear....

Addresses-Debian-Bug: #594004

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-25 20:24:18 -04:00
Theodore Ts'o b70506bffb e2fsck: Set i_blocks_hi when correcting the i_blocks field in pass #1
For file systems with 64-bit block numbers, we need to make sure we
correct the i_blocks_hi field as well as the i_blocks field when
setting it to the correct value.

Thanks to Justin Maggard for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-24 22:57:06 -04:00
Theodore Ts'o 9d92a201de Merge branch 'maint' into next
Conflicts:
	configure
	configure.in
	lib/ext2fs/ext2fs.h
	misc/mke2fs.c
2010-09-24 22:40:21 -04:00
Theodore Ts'o 73fbe2323a libext2fs: Change EXT2_FLAG_DIRECT_IO to avoid conflict with devel branch
The development branch of e2fsprogs already has a code point assigned
in conflict with EXT2_FLAG_DIRECT_IO.  Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-24 22:22:09 -04:00
Theodore Ts'o a946844235 debugfs: Make the extents listing in the stat command more concise
Use "[u]" instead of "[uninit]" and limit the amount of detail printed
for the extent tree blocks, so it is more similar to the format used
for direct/indirect mapped inodes.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-24 22:05:58 -04:00
Theodore Ts'o 0fd68e0241 debugfs: Add the -D option to request Direct I/O
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-24 10:12:54 -04:00
Theodore Ts'o 00f0b14118 ext2fs: Optimize for Direct I/O
Allocate various memory structures to be properly aligned to avoid
needing to use a bounce buffer when doing direct I/O read/writes.
This should also help on FreeBSD systems which require aligned buffers
unconditionally.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-24 10:06:45 -04:00
Theodore Ts'o 7f1a1fbf85 ext2fs: Add Direct I/O support to the ext2fs library
This adds the basic support for Direct I/O to unix_io.c, and adds a
new flag EXT_FLAG_DIRECT_IO which can be passed to ext2fs_open() or
ext2fs_open2() to request Direct I/O support.

Note that device mapper devices in Linux don't support Direct I/O, and
in some circumstances using Direct I/O can actually make performance
*worse*!

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-24 10:02:25 -04:00
Theodore Ts'o faafdb765b libext2fs: Fix memory leak in the Unix I/O layer when changing block size
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-23 16:38:26 -04:00
Theodore Ts'o 023a1df091 ext2fs: add ext2fs_get_memalign() function
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-23 16:38:22 -04:00
Eric Sandeen 792cce3092 mke2fs: make "invalid blocks count" error more clear
Mistakes on the commandline can lead to odd error messages:

# mke2fs -t ext4 -E stride=128 stripe-width=512 /dev/sda1
mke2fs: invalid blocks count - /dev/sda1

Making it a bit more explicit is more obvious:

mke2fs: invalid blocks count '/dev/sda1' on device 'stripe-width=512'

(hint, the mistake was no comma separation for -E)

Reported-by: Adam Huffman <bloch@verdurin.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-09-20 09:25:23 -04:00
Eric Sandeen 6fcd6f84c2 mke2fs: use lazy inode init on some discard-able devices
If a device supports discard -and- returns 0s for discarded blocks,
then we can skip the inode table initialization -and- the inode table
zeroing at mkfs time, and skip the lazy init as well since they are
already zeroed out.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-09-20 09:20:25 -04:00
Jan Kara 32f66cc791 e2fsck: Improve error message when device name misspelled
When a device name is misspelled, we output the full text about specifying
alternate superblock. This is slightly misleading because when the device
cannot be open because of ENOENT, this certainly won't help. So just print
that device does not exist and exit.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-09-19 22:54:58 -04:00
Theodore Ts'o c4b87b8c4f debugfs: Display the extent tree blocks in the stat command output
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-19 22:52:09 -04:00
Theodore Ts'o 9345f02671 tune2fs, debugfs, libext2fs: Add support for ext4 default mount options
Add support for 2.6.35's new default mount options which can be
specified in the superblock.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-09-18 19:38:22 -04:00
Theodore Ts'o 61ef2474c2 badblocks: Deal with UTF-8 characters in progress message
Addresses-Gentoo-Bug: #309909
Addresses-Debian-Bug: #583782
Addresses-Debian-Bug: #587834

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-08-01 22:30:33 -04:00
Tim Small e447ba3731 mke2fs: fix mke2fs "invalid inode ratio" error message
Make error message consistent with the validity test.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-30 20:43:11 -04:00
Eric Sandeen eddf36bac0 mke2fs.8.in: clarify the sign of a block-size constraint.
This bit of the mke2fs manpage is slightly confusing:

-b block-size
    Specify the size of blocks in bytes. <snip>
    If block-size is negative, then mke2fs will use heuristics
    to determine the appropriate block size, with the constraint
    that the block size will be at least block-size bytes.

because it sounds like the block size will be at least a negative
number.  Clarify just what the negative sign means.

Reported-by: Chris Frost <chris@frostnet.net>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-07-30 20:40:23 -04:00
Theodore Ts'o ccc7cf0328 libext2fs: fix obvious big-endian bugs introduced by 64-bit changes
These patches fix obvious bone-headed mistakes, so e2fsprogs will now
build and mostly work on powerpc.  The m_meta_bg, u_mke2fs, and
u_tune2fs tests are still failing, however, so there's still work to do...

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-30 18:41:47 -04:00
Theodore Ts'o 27a0e958e6 libext2fs: Add ext2fs_file_size_size2() and truncate the file if necessary
This adds a 64-bit interface for ext2fs_file_size_size() and enhances
it to trunate the file if necessary.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-30 15:40:53 -04:00
Renzo Davoli 6dc058bd12 libext2fs: Add new function ext2fs_file_get_inode()
This patch adds a very simple function:

	struct ext2_inode *ext2fs_file_get_inode(ext2_file_t file);

which is useful for fuse-ext2 when it needs to read the inode of an
open file.

Signed-off-by: renzo davoli <renzo@cs.unibo.it>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-07-22 09:40:25 -04:00
Theodore Ts'o 8668592362 debugfs: Add new debugfs command punch (aka truncate)
This uses the newly added ext2fs_punch() function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-22 09:39:04 -04:00
Theodore Ts'o 3adb9374fb libext2fs: Add new function ext2fs_punch()
This function deallocates a range of blocks from a passed-in file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-22 09:37:35 -04:00
Theodore Ts'o f03bb73ceb libext2fs: Don't make a copy of the inode in ext2fs_extent_open2()
Previously, ext2fs_extent_open2() copied the passed-in inode structure
into the extent handle, and the extent functions modified the copy of
the inode structure if necessary due to extent splits, etc.  Change
ext2fs_extent_open2() so that the extent functions use the inode
structure passed into ext2fs_extent_open2().  Otherwise the passed-in
inode structure could become out of date due to changes made by the
extent functions.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-22 09:27:45 -04:00
Theodore Ts'o 47e155df57 libext2fs: Fix ext2fs_iblk_{add,sub}_blocks() when the i_blocks_hi is non-zero
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-21 16:10:10 -04:00
Theodore Ts'o 92e2d79cfb tst_extents: Fix 64-bit bugs in do_goto_block()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-20 11:36:34 -04:00