OSDN Git Service
Theodore Ts'o [Mon, 20 Dec 2010 15:06:58 +0000 (10:06 -0500)]
Merge branch 'maint' into next
Conflicts:
lib/ext2fs/block.c
lib/ext2fs/csum.c
resize/main.c
Theodore Ts'o [Fri, 17 Dec 2010 04:20:11 +0000 (23:20 -0500)]
Merge branch 'master' into next
Conflicts:
e2fsck/e2fsck.h
e2fsck/unix.c
Theodore Ts'o [Fri, 17 Dec 2010 03:53:34 +0000 (22:53 -0500)]
e4defrag: Fix the overflow in e4defrag with > 2GB files
The fallocate() interface on 32-bit machines is defined to use off_t,
not loff_t (even though the system call interface is 64-bit clean).
This causes e4defrag to fail on files greater than 2GB. Fix this by
trying to use fallocate64(), and using the hard-coded syscall if it
does not exist.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 17 Dec 2010 03:11:43 +0000 (22:11 -0500)]
libext2fs: Fix compile bug on big-endian architectures
Addresses-Sourceforge-Bug: #
3138115
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 17 Dec 2010 00:34:24 +0000 (19:34 -0500)]
libext2fs: fix ref_offset callback with sparse files in ext2fs_block_iterate2()
Addresses-Sourceforge-Bug:
3081087
Reported-by: vmo@users.sourceforge.net
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Thu, 16 Dec 2010 04:37:34 +0000 (22:37 -0600)]
resize2fs: handle exactly-16T filesystems in resize2fs
Before we go whole-hog on 64-bit e2fsprogs, I wonder if this
is worth considering as a last-minute addition to the 1.41
stream. Currently, mke2fs will shave a block off an exactly-16T
device to fit*, but resize2fs does not do the same, leading
to some asymmetry. This patch fixes that up, and allows 16T
devices to be handled more gracefully in offline resize.
(in fact resize2fs will not even open a 16T device, today).
*commit
37d17a65ecb4615546b417038190a41bafca7c51
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Tue, 14 Dec 2010 19:00:01 +0000 (13:00 -0600)]
e2fsprogs: fix type-punning warnings
Flags used during RHEL/Fedora builds lead to a couple type-punning
warnings:
recovery.c: In function 'do_one_pass':
recovery.c:539: warning: dereferencing type-punned pointer will break strict-aliasing rules
./csum.c: In function 'print_csum':
./csum.c:170: warning: dereferencing type-punned pointer will break strict-aliasing rules
The two changes below fix this up.
Note that the csum test binary output changes slightly, but this does
not break any tests.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Mon, 13 Dec 2010 14:59:07 +0000 (09:59 -0500)]
e4defrag: update man page about -c option
Add the description of the size per one extent and the maximum extent size
in ext4 into e4defrag man page.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Mon, 13 Dec 2010 14:59:07 +0000 (09:59 -0500)]
e4defrag: avoid unsuccessful return for an non-privileged user
If non-privileged user runs e4defrag, e4defrag returns an exit status
of 1 despite its success. This patch fixes this problem.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Mon, 13 Dec 2010 14:59:06 +0000 (09:59 -0500)]
e4defrag: fix file blocks calculation
e4defrag uses st_blocks (struct stat) to calculate file blocks. However,
st_blocks also has meta data blocks in addition to file blocks. So, we
calculate file blocks by sum of the extent length.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Kazuya Mio [Mon, 13 Dec 2010 14:57:26 +0000 (09:57 -0500)]
e4defrag: output size per extent by -c option
e4defrag with -c option outputs "ratio" that means the levels of
fragmentation. However, it's difficult for users to understand, so we will
use size per extent instead of ratio.
Before:
# e4defrag -c /mnt/mp1/file
<File> now/best ratio
/mnt/mp1/file 6/1 0.00%
Total/best extents 6/1
Fragmentation ratio 0.00%
Fragmentation score 0.04
[0-30 no problem: 31-55 a little bit fragmented: 55- needs defrag]
This file(/mnt/mp1/file) does not need defragmentation.
Done.
After:
# e4defrag -c /mnt/mp1/file
<File> now/best size/ext
/mnt/mp1/file 6/1 16666 KB
Total/best extents 6/1
Average size per extent 16666 KB
Fragmentation score 0
[0-30 no problem: 31-55 a little bit fragmented: 56- needs defrag]
This file (/mnt/mp1/file) does not need defragmentation.
Done.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Peng Tao [Mon, 13 Dec 2010 14:44:57 +0000 (09:44 -0500)]
e4defrag: return more specific error message on ioctl failure
Currently e4defrag relies on the EXT4_IOC_MOVE_EXT ioctl to perform online
defragmentation. However, this iotcl kernel patch is not available before
2.6.30-rc1. e4defrag shall fail without obvious reasons on systems running
older kernels. The patch adds more detailed error message addressing this
issue and prompts users with the minimal kernel version that is needed to
run e4defrag.
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Eric Sandeen [Tue, 8 Sep 2009 06:13:50 +0000 (06:13 +0000)]
e4defrag: skip "rootfs" entry when checking for ext4 filesystem
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Darrick J. Wong [Mon, 13 Dec 2010 14:23:45 +0000 (09:23 -0500)]
e4defrag: open the file to be defragged in read/write mode
Akira Fujita merged a patch into 2.6.33 that adds a requirement that a
file being defragged must be opened with read and write access, so
e2fsprogs needs to satisfy that.
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 13 Dec 2010 14:16:09 +0000 (09:16 -0500)]
Merge branch 'maint' into next
Conflicts:
e2fsck/pass4.c
misc/dumpe2fs.c
resize/online.c
Theodore Ts'o [Mon, 13 Dec 2010 13:57:14 +0000 (08:57 -0500)]
Update Release Notes, Changelogs, version.h, etc. for 1.41.13 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Bernd Schubert [Fri, 12 Nov 2010 23:09:07 +0000 (00:09 +0100)]
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>
Theodore Ts'o [Mon, 6 Dec 2010 22:07:27 +0000 (17:07 -0500)]
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>
Theodore Ts'o [Mon, 6 Dec 2010 15:10:33 +0000 (10:10 -0500)]
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>
Andreas Dilger [Mon, 6 Dec 2010 03:20:19 +0000 (22:20 -0500)]
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>
Theodore Ts'o [Wed, 1 Dec 2010 23:49:26 +0000 (18:49 -0500)]
mke2fs: Fix (minor) memory leaks
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 1 Dec 2010 23:28:35 +0000 (18:28 -0500)]
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>
Theodore Ts'o [Sat, 27 Nov 2010 00:42:15 +0000 (19:42 -0500)]
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>
Theodore Ts'o [Sat, 27 Nov 2010 00:35:30 +0000 (19:35 -0500)]
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>
Theodore Ts'o [Sat, 27 Nov 2010 00:25:26 +0000 (19:25 -0500)]
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>
Theodore Ts'o [Sat, 27 Nov 2010 00:09:43 +0000 (19:09 -0500)]
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>
Theodore Ts'o [Fri, 26 Nov 2010 23:07:32 +0000 (18:07 -0500)]
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>
Lukas Czerner [Thu, 18 Nov 2010 03:38:40 +0000 (03:38 +0000)]
mke2fs: Use unix_discard() for discards
There is generic discard function in struct_io_manager, or in
unix_io_manager to be specific. So use this instead of
mke2fs_discard_blocks().
Since mke2fs_discard_blocks() is not used anymore (and should not be)
remove it.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Thu, 18 Nov 2010 03:38:38 +0000 (03:38 +0000)]
e2fsck: Discard free data and inode blocks.
In Pass 5 when we are checking block and inode bitmaps we have great
opportunity to discard free space and unused inodes on the device,
because bitmaps has just been verified as valid. This commit takes
advantage of this opportunity and discards both, all free space and
unused inodes.
I have added new set of options, 'nodiscard' and 'discard'. When the
underlying devices does not support discard, or discard ends with an
error, or when any kind of error occurs on the filesystem, no further
discard attempt will be made and the e2fsck will behave as it would
with nodiscard option provided.
As an addition, when there is any not-yet-zeroed inode table and
discard zeroes data, then inode table is marked as zeroed.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Thu, 18 Nov 2010 03:38:37 +0000 (03:38 +0000)]
e2fsprogs: Add CHANNEL_FLAGS_DISCARD_ZEROES flag for io_manager
When the device have discard support and simultaneously discard zeroes
data (and it is properly advertised), then we can take advantage of such
behavior in several e2fsprogs tools.
Add new flag CHANNEL_FLAGS_DISCARD_ZEROES for struct_io_channel so
each io_manager can take advantage of this. The flag is properly set
according to BLKDISCARDZEROES ioctl in unix_open.
Also remove old mke2fs_discard_zeroes_data() function and substitute it
with helper which test this flag.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Lukas Czerner [Thu, 18 Nov 2010 03:38:36 +0000 (03:38 +0000)]
e2fsprogs: Add discard function into struct_io_manager
In order to provide generic "discard" function for all e2fsprogs tools
add a discard function prototype into struct_io_manager. Specific
function for specific io managers can be crated that way.
This commit also creates unix_discard function which uses BLKDISCARD
ioctl to discard data blocks on the block device and bind it into
unit_io_manager structure to be available for all e2fsprogs tools.
Note that BLKDISCARD is still Linux specific ioctl, however other
unix systems may provide similar functionality. So far the
unix_discard() remains linux specific hence is embedded in #ifdef
__linux__ macro.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Justin Maggard [Mon, 22 Nov 2010 22:32:28 +0000 (17:32 -0500)]
Fix EXT4_FEATURE_RO_COMPAT_HUGE_FILE check
Creating a 4TB file on a filesystem with the 64bit flag set results in
e2fsck consistently complaining about i_blocks being wrong, with
confusing messages like this:
Inode
29818882, i_blocks is
8388608816, should be
8388608816. Fix? no
That appears to be caused by ext2fs_inode_i_blocks() checking for the
EXT4_FEATURE_RO_COMPAT_HUGE_FILE in the wrong place. Fix it.
Signed-off-by: Justin Maggard <jmaggard10@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 22 Nov 2010 21:33:39 +0000 (16:33 -0500)]
Merge branch 'maint'
Theodore Ts'o [Mon, 22 Nov 2010 21:10:23 +0000 (16:10 -0500)]
Update Release Notes, Changelogs, version.h, etc. for 1.41.13 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 22 Nov 2010 20:20:36 +0000 (15:20 -0500)]
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>
Lukas Czerner [Thu, 18 Nov 2010 13:38:41 +0000 (14:38 +0100)]
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>
Lukas Czerner [Thu, 18 Nov 2010 13:38:39 +0000 (14:38 +0100)]
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>
Theodore Ts'o [Mon, 22 Nov 2010 16:14:35 +0000 (11:14 -0500)]
mke2fs: Force the default blocksize to be at least the logical sector size
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 22 Nov 2010 16:09:00 +0000 (11:09 -0500)]
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>
Theodore Ts'o [Mon, 22 Nov 2010 15:50:42 +0000 (10:50 -0500)]
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>
Theodore Ts'o [Sun, 21 Nov 2010 14:56:53 +0000 (09:56 -0500)]
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>
Theodore Ts'o [Fri, 1 Oct 2010 14:47:38 +0000 (10:47 -0400)]
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>
Theodore Ts'o [Sun, 26 Sep 2010 01:41:21 +0000 (21:41 -0400)]
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>
Theodore Ts'o [Sun, 26 Sep 2010 01:14:06 +0000 (21:14 -0400)]
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>
Theodore Ts'o [Sun, 26 Sep 2010 00:23:33 +0000 (20:23 -0400)]
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>
Theodore Ts'o [Sat, 25 Sep 2010 02:57:06 +0000 (22:57 -0400)]
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>
Theodore Ts'o [Sat, 25 Sep 2010 02:40:21 +0000 (22:40 -0400)]
Merge branch 'maint' into next
Conflicts:
configure
configure.in
lib/ext2fs/ext2fs.h
misc/mke2fs.c
Theodore Ts'o [Sat, 25 Sep 2010 02:22:09 +0000 (22:22 -0400)]
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>
Theodore Ts'o [Sat, 25 Sep 2010 02:05:58 +0000 (22:05 -0400)]
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>
Theodore Ts'o [Fri, 24 Sep 2010 14:12:54 +0000 (10:12 -0400)]
debugfs: Add the -D option to request Direct I/O
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 24 Sep 2010 14:06:45 +0000 (10:06 -0400)]
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>
Theodore Ts'o [Fri, 24 Sep 2010 14:02:25 +0000 (10:02 -0400)]
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>
Theodore Ts'o [Thu, 23 Sep 2010 17:06:31 +0000 (13:06 -0400)]
libext2fs: Fix memory leak in the Unix I/O layer when changing block size
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Thu, 23 Sep 2010 16:56:46 +0000 (12:56 -0400)]
ext2fs: add ext2fs_get_memalign() function
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Thu, 12 Aug 2010 18:40:44 +0000 (14:40 -0400)]
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>
Eric Sandeen [Fri, 20 Aug 2010 21:41:14 +0000 (16:41 -0500)]
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>
Jan Kara [Wed, 8 Sep 2010 14:12:08 +0000 (16:12 +0200)]
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>
Theodore Ts'o [Mon, 20 Sep 2010 02:52:09 +0000 (22:52 -0400)]
debugfs: Display the extent tree blocks in the stat command output
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sat, 18 Sep 2010 23:38:22 +0000 (19:38 -0400)]
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>
Theodore Ts'o [Mon, 2 Aug 2010 02:30:33 +0000 (22:30 -0400)]
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>
Tim Small [Sat, 31 Jul 2010 00:43:11 +0000 (20:43 -0400)]
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>
Eric Sandeen [Thu, 29 Jul 2010 16:59:42 +0000 (11:59 -0500)]
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>
Theodore Ts'o [Fri, 30 Jul 2010 22:41:47 +0000 (18:41 -0400)]
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>
Theodore Ts'o [Thu, 22 Jul 2010 13:51:23 +0000 (09:51 -0400)]
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>
Renzo Davoli [Sat, 10 Jul 2010 13:32:46 +0000 (15:32 +0200)]
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>
Theodore Ts'o [Thu, 22 Jul 2010 13:39:04 +0000 (09:39 -0400)]
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>
Theodore Ts'o [Thu, 22 Jul 2010 13:37:35 +0000 (09:37 -0400)]
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>
Theodore Ts'o [Thu, 22 Jul 2010 13:27:45 +0000 (09:27 -0400)]
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>
Theodore Ts'o [Wed, 21 Jul 2010 20:10:10 +0000 (16:10 -0400)]
libext2fs: Fix ext2fs_iblk_{add,sub}_blocks() when the i_blocks_hi is non-zero
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 20 Jul 2010 15:36:34 +0000 (11:36 -0400)]
tst_extents: Fix 64-bit bugs in do_goto_block()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 19 Jul 2010 06:37:41 +0000 (02:37 -0400)]
Merge branch 'maint' into next
Conflicts:
resize/extent.c
Theodore Ts'o [Mon, 19 Jul 2010 06:27:07 +0000 (02:27 -0400)]
debian: Fix outdated description: /sbin/fsck has moved to util-linux
Addresses-Debian-Bug: #588726
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 19 Jul 2010 06:23:12 +0000 (02:23 -0400)]
resize2fs.8: Update man page to indicate ext4 supports on-line resize
Addresses-Debian-Bug: #589345
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Mon, 12 Jul 2010 18:27:44 +0000 (13:27 -0500)]
resize2fs: relax requirements for -P output a bit
Requiring an immediate pre-fsck before printing a minimum
resize size seems a bit draconian; if the fs isn't clean or marked
with error, then certainly, but for an informational minimum
size, I don't think we need to require a fsck since last mount.
I had simply copied the checks from the actual resize path,
previously.
Installers use this option (-P) to gather minimum resize info,
and requiring an actual fsck before use just seems to go too far.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Tue, 6 Jul 2010 18:08:09 +0000 (14:08 -0400)]
debian: Remove obsolete initrd script
Addresses-Debian-Bug: #585041
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 6 Jul 2010 00:40:41 +0000 (20:40 -0400)]
e2fsck, resize2fs: fix a fp precision error that can lead to a seg fault
Commit
641b66b fixed a floating point precision error which can result
in a search algorithm looping forever. It can also result in an array
index being out of bounds and causing a segfault. Here are two more
cases in e2fsck and resize2fs that need to be fixed. I've just used
the same fix from the that commit.
Signed-off-by: Lachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 5 Jul 2010 19:06:37 +0000 (15:06 -0400)]
e2fsck: Add missing ext2fs_close() call when going back to original superblock
In the case where the original superblock and the backup superblock
are both invalid in some way, e2fsck will try to go back to the
orignal superblock. To do that, it must close the attempted open
using the backup superblock first (since otherwise the exclusive open
will prevent the subsequent open from succeding).
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Mike Frysinger [Tue, 5 Jan 2010 04:15:32 +0000 (23:15 -0500)]
e2freefrag: Fix getopt bug on machines with unsigned chars
The getopt() function returns an int, not a char. On systems where the
default char is unsigned (like ppc), we get weird behavior where -1 is
truncated to 0xff but compared to (int)-1.
Also fix this same bug for two test programs, test_rel and iscan,
which aren't currently used at the moment.
Addresses-Gentoo-Bug: #299386
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Mon, 5 Jul 2010 18:51:47 +0000 (14:51 -0400)]
e2freefrag: Display the total number of free extents
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 5 Jul 2010 18:50:17 +0000 (14:50 -0400)]
Enhance tst_super_size so that it checks the superblock fields as well
The test now checks to make sure the superblock fields are correctly
aligned and prints them out so they can be manually checked to make
sure they are where we expect them to be.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 25 Jun 2010 14:53:13 +0000 (10:53 -0400)]
Add superblock fields which track first and most recent fs errors
Add superblock fields which track where and when the first and most
recent file system errors occured. These fields are displayed by
dumpe2fs and cleared by e2fsck.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 25 Jun 2010 01:11:01 +0000 (21:11 -0400)]
Fix Makefile dependencies for test programs in lib/ext2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 25 Jun 2010 01:08:37 +0000 (21:08 -0400)]
Add support for Next3 snapshot superblock fields to dumpe2fs and debugfs
We also support for byte-swapping the Next3 fields, although the
current Next3 implementation doesn't support big-endian systems.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Eric Sandeen [Mon, 14 Jun 2010 01:00:00 +0000 (21:00 -0400)]
libext2fs: make fs->group_desc opaque
To prevent direct array indexing of fs->group_desc[i] (because the
group_desc may be a different size for different filesystems) make it
an opaque pointer that may only be accessed through the accessor
functions in blknum.c. The type itself is still available in a public
header; if we have a group_desc that we know is one type or another,
it's ok to access its fields directly. This change only prevents us
from indexing off fs->group_desc[i] directly.
Old-style applications who don't want to change their source code can
(as a temporary short-term hack) #define EXT2FS_OLD_32_COMPAT before
including ext2fs.h.
Change the accessors in blknum.c to use ext4fs_group_desc(), a version
of ext2fs_group_desc() which returns a ext4_group_desc pointer.
This simplifies and collapses a fair bit of code in blknum.c
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Valerie Aurora Henson [Mon, 14 Jun 2010 00:00:00 +0000 (20:00 -0400)]
e2image: Fix up to be 64-bit block number safe
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Valerie Aurora Henson [Sun, 13 Jun 2010 23:00:00 +0000 (19:00 -0400)]
e2image: Fix up to be 64-bit block number safe
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
Signed-off-by: Valerie Aurora (Henson) <vaurora@redhat.com>
Valerie Aurora Henson [Sun, 13 Jun 2010 22:00:00 +0000 (18:00 -0400)]
resize2fs: Fix up to be 64-bit block number safe
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Valerie Aurora Henson [Sun, 13 Jun 2010 21:00:00 +0000 (17:00 -0400)]
e2fsck: Fix up to be 64-bit block number safe
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>
Valerie Aurora Henson [Sun, 13 Jun 2010 20:00:00 +0000 (16:00 -0400)]
tune2fs: Fix up to be 64-bit block number safe
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 13 Jun 2010 19:00:00 +0000 (15:00 -0400)]
dumpe2fs: Fix up to be 64-bit block number safe
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 13 Jun 2010 18:00:00 +0000 (14:00 -0400)]
mke2fs: Fix up the fs type and feature selection for 64-bit blocks
We need to defer setting the blocks count field in the fs_param
structure until it is known whether 64-bit feature will be enabled
(and whether the blocks count is valid).
We also add a new mke2fs.conf configuration parameter,
auto_64-bit_support which will automatically enable the 64-bit feature
if the number of blocks requires it.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Jose R. Santos [Sun, 13 Jun 2010 17:00:00 +0000 (13:00 -0400)]
mke2fs: Fix up mke2fs to be able to make 64-bit file systems
Use 64-bit interfaces in mke2fs. This should be most most of whats
needed to support creating a 64-bit filesystem.
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
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>
Valerie Aurora Henson [Sun, 13 Jun 2010 16:00:00 +0000 (12:00 -0400)]
badblocks: Use ext2fs_get_device_size2()
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Valerie Aurora Henson [Sun, 13 Jun 2010 15:00:00 +0000 (11:00 -0400)]
libext2fs: More random 64-bit fixes, lots of block_iterate3
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 13 Jun 2010 14:00:00 +0000 (10:00 -0400)]
libext2fs: Create 64-bit dblist functions
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Sun, 13 Jun 2010 13:00:00 +0000 (09:00 -0400)]
libext2fs: Teach *_initialize and *_allocate_group to be 64-bit safe
This is needed to enable 64-bit mke2fs to work correctly.
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
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>
Theodore Ts'o [Mon, 7 Jun 2010 16:42:40 +0000 (12:42 -0400)]
Merge branch 'maint' into next
Conflicts:
e2fsck/journal.c
e2fsck/pass1.c
e2fsck/pass2.c
misc/mke2fs.c
Theodore Ts'o [Mon, 7 Jun 2010 16:25:11 +0000 (12:25 -0400)]
po: update zh_CN.po (from translationproject.org)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 7 Jun 2010 16:24:43 +0000 (12:24 -0400)]
po: update vi.po (from translationproject.org)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Mon, 7 Jun 2010 16:24:21 +0000 (12:24 -0400)]
po: update de.po (from translationproject.org)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>