]> git.ipfire.org Git - thirdparty/e2fsprogs.git/log
thirdparty/e2fsprogs.git
10 years agodebian: update debian/patches for 1.42.9-2 release debian-1.42.9-2
Theodore Ts'o [Mon, 30 Dec 2013 22:59:16 +0000 (17:59 -0500)] 
debian: update debian/patches for 1.42.9-2 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebian: update changelog for 1.42.9-2 release
Theodore Ts'o [Mon, 30 Dec 2013 20:58:58 +0000 (15:58 -0500)] 
debian: update changelog for 1.42.9-2 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebian: rationalize configure options management
Theodore Ts'o [Mon, 30 Dec 2013 22:35:58 +0000 (17:35 -0500)] 
debian: rationalize configure options management

As part of the debian build, the e2fsprogs sources are built multiple
times --- for the udeb packages, for e2fsck.static, etc.  Make sure
that when we disable the use of the built-in blkid and uuid libraries
(in favor of the ones shipped with util-linux), that we do so for all
of the builds.

Previously we were using the internal blkid library for e2fsck.static.
While this isn't completely broken, the internal blkid library hasn't
been maintained in quite some time, so it's better to use the
util-linux blkid library instead.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs: restore and tweak original error messaging
Eric Whitney [Mon, 30 Dec 2013 21:43:46 +0000 (16:43 -0500)] 
debugfs: restore and tweak original error messaging

In response to reviewer comments, commit fe56188b07 included changes
that modified some of the code used to output error messages when
checking user-supplied block numbers.  These changes converted calls
to parse_ulonglong() to calls to strtoblk().  Because strtoblk() calls
parse_ulonglong(), and both output error messages, two redundant and
relatively generic messages were output on each error.

Fix this by removing the error message output from strtoblk(), and
extending it to accept an optional error message argument that it
supplies in lieu of a default to parse_ulonglong().  Also, revert to
the more descriptive original error messages with mods per reviewer
comments, and fix an error message in do_replace_node().

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: fix printf format type match
Theodore Ts'o [Mon, 30 Dec 2013 21:12:27 +0000 (16:12 -0500)] 
e2image: fix printf format type match

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebian: use dh_strip --dbg-package to populate the dbg packages
Theodore Ts'o [Mon, 30 Dec 2013 20:48:06 +0000 (15:48 -0500)] 
debian: use dh_strip --dbg-package to populate the dbg packages

Use the --dbg-package option instead of manually moving the files into
the debug packages.  This is simpler to maintain, and avoids a problem
where creating directories using mkdir -p can create world-writeable
/usr/lib directory dependind on the umask used by the Debian buildd.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoUpdate release notes, etc., for final 1.42.9 release v1.42.9
Theodore Ts'o [Sun, 29 Dec 2013 03:39:41 +0000 (22:39 -0500)] 
Update release notes, etc., for final 1.42.9 release

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agopo: update vi.po (from translationproject.org)
Trần Ngọc Quân [Sun, 29 Dec 2013 03:34:45 +0000 (22:34 -0500)] 
po: update vi.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update tr.po (from translationproject.org)
Volkan Gezer [Sun, 29 Dec 2013 03:34:45 +0000 (22:34 -0500)] 
po: update tr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Sun, 29 Dec 2013 03:34:45 +0000 (22:34 -0500)] 
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Sun, 29 Dec 2013 03:34:45 +0000 (22:34 -0500)] 
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Sun, 29 Dec 2013 03:34:45 +0000 (22:34 -0500)] 
po: update nl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Sun, 29 Dec 2013 03:34:45 +0000 (22:34 -0500)] 
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Sun, 29 Dec 2013 03:34:44 +0000 (22:34 -0500)] 
po: update de.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Sun, 29 Dec 2013 03:34:44 +0000 (22:34 -0500)] 
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update ca.po (from translationproject.org)
Walter Garcia-Fontes [Sun, 29 Dec 2013 03:34:44 +0000 (22:34 -0500)] 
po: update ca.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoe2freefrag: avoid integer overflow when reporting free space statistics
Theodore Ts'o [Sun, 29 Dec 2013 03:25:11 +0000 (22:25 -0500)] 
e2freefrag: avoid integer overflow when reporting free space statistics

An integer overflow could happen if the file system is large and has
very large contiguous chunks of free space.

Addresses-Debian-Bug: #718205

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs: document the lsdel command in the man page
Theodore Ts'o [Sun, 29 Dec 2013 03:15:59 +0000 (22:15 -0500)] 
debugfs: document the lsdel command in the man page

Addresses-Debian-Bug: #731329

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agomke2fs: clarify documentation about bigalloc in the man page
Theodore Ts'o [Sat, 28 Dec 2013 22:50:54 +0000 (17:50 -0500)] 
mke2fs: clarify documentation about bigalloc in the man page

Addresses-Debian-Bug: #669730

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebian: fix cross build support
Theodore Ts'o [Sat, 28 Dec 2013 22:21:17 +0000 (17:21 -0500)] 
debian: fix cross build support

We need to explicitly specify the $DEB_BUILD_HOST when querying for
the version of the libblkid1 package.

Addresses-Debian-Bug: #721365

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agomke2fs: clarify the description of the -I option in the man page
Theodore Ts'o [Sat, 28 Dec 2013 22:06:38 +0000 (17:06 -0500)] 
mke2fs: clarify the description of the -I option in the man page

Addresses-Debian-Bug: #698076

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebian: update debian-policy conormance to 3.9.5
Theodore Ts'o [Sat, 28 Dec 2013 21:28:56 +0000 (16:28 -0500)] 
debian: update debian-policy conormance to 3.9.5

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agogen-tarball: ignore all of the build* directories
Theodore Ts'o [Sat, 28 Dec 2013 20:57:29 +0000 (15:57 -0500)] 
gen-tarball: ignore all of the build* directories

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoUse makeinfo --html instead of texi2html
Theodore Ts'o [Sat, 28 Dec 2013 20:40:56 +0000 (15:40 -0500)] 
Use makeinfo --html instead of texi2html

The texi2html utility from the texi2html ceased being developed
upstream in 2011, and upstream has declared it superseded by the
makeinfo utility from the texinfo package.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: Clarify e2image's usage message
Theodore Ts'o [Fri, 27 Dec 2013 06:08:25 +0000 (01:08 -0500)] 
e2image: Clarify e2image's usage message

Also reflect a similar change to e2image's man page.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: write progress information to stderr
Theodore Ts'o [Fri, 27 Dec 2013 06:04:32 +0000 (01:04 -0500)] 
e2image: write progress information to stderr

This allows "e2image -rp /dev/sdc1 - | bzip2 > sdc1.img.bz2" to work
correctly, so the progress information doesn't corrupt the image being
sent to stdout.

Also add a diagnostic indicating that the -p option is currently only
implemented for raw mode.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: clean up progress reporting
Theodore Ts'o [Fri, 27 Dec 2013 04:45:17 +0000 (23:45 -0500)] 
e2image: clean up progress reporting

The old progress reporting code would crash on small file systems.
For example:

    cp /dev/null /tmp/foo.img
    mke2fs -t ext4 -F /tmp/foo.img 100
    e2image -o 0 -O 4096 -rap /tmp/foo.img

Fix this, and while we're at it, factor out the code to make it easier
to read and maintain.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agotests: fix stray newline printed when running r_min_itable
Theodore Ts'o [Thu, 26 Dec 2013 05:37:09 +0000 (00:37 -0500)] 
tests: fix stray newline printed when running r_min_itable

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodumpe2fs: don't try to print the journal info when using image files
Theodore Ts'o [Thu, 26 Dec 2013 03:53:00 +0000 (22:53 -0500)] 
dumpe2fs: don't try to print the journal info when using image files

If dumpe2fs tries to print journal info when using an image file
created using e2image, it will crash since the journal isn't
available.  So don't even try to print it.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: make sure all strings are marked for internationalization
Theodore Ts'o [Thu, 26 Dec 2013 03:52:23 +0000 (22:52 -0500)] 
e2image: make sure all strings are marked for internationalization

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: add -n option to show what blocks would have been written
Theodore Ts'o [Thu, 26 Dec 2013 01:22:03 +0000 (20:22 -0500)] 
e2image: add -n option to show what blocks would have been written

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: add -c option to optimize file system copying for flash devices
Theodore Ts'o [Wed, 25 Dec 2013 21:46:39 +0000 (16:46 -0500)] 
e2image: add -c option to optimize file system copying for flash devices

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: only skip writing zero blocks when writing to a new file
Theodore Ts'o [Wed, 25 Dec 2013 21:33:52 +0000 (16:33 -0500)] 
e2image: only skip writing zero blocks when writing to a new file

The e2image progam was originally intended to create image files.
However, some people have started using e2image to copy a file system
from one block device to another, since it is more efficient than
using dd because it only copies the blocks which are in use.  If we
are doing this, however, we must not skip writing blocks which are all
zero in the source device, since they may not be zero in the
destination device.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Phillip Susi <psusi@ubuntu.com>
10 years agoe2image: clean up gcc -Wall and sparse nits
Theodore Ts'o [Wed, 25 Dec 2013 19:26:44 +0000 (14:26 -0500)] 
e2image: clean up gcc -Wall and sparse nits

Fix up the gcc -Wall and sparse nits introduced by Phillip Susi's
e2image patches.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Phillip Susi <psusi@ubuntu.com>
10 years agoe2image: refactor calls to ext2fs_llseek()
Theodore Ts'o [Wed, 25 Dec 2013 19:20:22 +0000 (14:20 -0500)] 
e2image: refactor calls to ext2fs_llseek()

Refactor calls to ext2fs_llseek().  This makes the code more compact,
easier to read, and it also fixes a number of places where we call
ext2fs_llseek() without doing proper error checking.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: handle SIGINT safely
Phillip Susi [Wed, 25 Dec 2013 04:41:34 +0000 (23:41 -0500)] 
e2image: handle SIGINT safely

When doing an in place move, interrupting it past the
point of no return will destroy the filesystem since
parts of it have been overwritten.  Catch SIGINT the
first time and issue a warning if this is the case.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: add progress indicator
Phillip Susi [Tue, 8 Oct 2013 15:56:31 +0000 (11:56 -0400)] 
e2image: add progress indicator

When given the -p switch, print progress information, including
block counts, percentage complete, estimated time remaining, and
throughput.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: perform in-place move
Phillip Susi [Mon, 16 Dec 2013 16:33:19 +0000 (11:33 -0500)] 
e2image: perform in-place move

If given at least one offset and only one file, assume source
and dest are the same, and do an in place move.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: add offset switches
Phillip Susi [Mon, 16 Dec 2013 16:32:39 +0000 (11:32 -0500)] 
e2image: add offset switches

Add -o and -O switches to specify the offset where the source
and destination filesystems start.  This is useful if you have
an image of a partitioned disk or wish to create one.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: checksum bg descriptors larger than 64 bytes
Theodore Ts'o [Wed, 25 Dec 2013 04:19:07 +0000 (23:19 -0500)] 
libext2fs: checksum bg descriptors larger than 64 bytes

Currently the ext4 block group descriptor is 64 bytes.  In case we
need to support larger block group descriptors in the future, teach
ext2fs_group_desc_csum() to checksum parts of the block group
descriptors that libext2fs doesn't yet understand.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agotests: use the in-tree binaries in the test f_extent_oobounds test_maint
Theodore Ts'o [Wed, 25 Dec 2013 03:44:14 +0000 (22:44 -0500)] 
tests: use the in-tree binaries in the test f_extent_oobounds

Fix the f_extent_oobounds test so that it uses binaries built in the
tree, instead of the binaries in the system PATH (which might not
exist in a chroot environment) when creating the test image.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs: fix extent header in do_write for big-endian machines
Theodore Ts'o [Wed, 25 Dec 2013 03:40:01 +0000 (22:40 -0500)] 
debugfs: fix extent header in do_write for big-endian machines

Commit a17e9f30 set up the extent header for a new file.
Unfortunately it didn't correctly handle byte swapping; fix this so
the regression tests pass on PowerPC systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Eric Sandeen <sandeen@redhat.com>
10 years agoAdd ext4 man page and update and clean up the other man pages
Theodore Ts'o [Tue, 24 Dec 2013 20:15:31 +0000 (15:15 -0500)] 
Add ext4 man page and update and clean up the other man pages

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs: silence build warning and remove incorrect error message
Eric Whitney [Tue, 24 Dec 2013 16:04:42 +0000 (11:04 -0500)] 
debugfs: silence build warning and remove incorrect error message

Commit fe56188b07 modified the code used to check the block number
argument to the command line -s switch, adding a call to com_err().
This causes a compile time warning because the third argument to
com_err() isn't a string.  Also, when the block number argument is
bad it outputs an incorrect error message - "Operation not permitted".

Fix these minor problems by removing the call to com_err().  Other
code provides enough error reporting information in this case.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2fsck: fix printf conversion specs in ea_refcount.c
Eric Whitney [Tue, 24 Dec 2013 06:58:09 +0000 (01:58 -0500)] 
e2fsck: fix printf conversion specs in ea_refcount.c

Commit 130e961a6fb9d38997c83c6397cf9ddb5ed2491f changed the type
used to represent block numbers in ea_refcount.c from blk_t to blk64_t
to add support for 64 bit extended attribute refcounting.  We also
need to adjust printf conversion specs that now don't match their new
blk64_t arguments.  This will silence compiler warnings seen when
"make check" is run and will avoid truncation of printed values.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agomke2fs: further updates for mke2fs(8) man page
Andreas Dilger [Mon, 23 Dec 2013 21:09:49 +0000 (16:09 -0500)] 
mke2fs: further updates for mke2fs(8) man page

The mke2fs(8) man page was updated in 4727c67dc2, but needs some
more clear descriptions for extra_isize and metadta_csum features.
The uninit_bg feature is supported by all ext4-capable kernels,
and does have a slow e2fsck pass for newly-formatted filesystems,
so remove the caveat.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs, e2fsck: fix s_desc_size handling
Andreas Dilger [Mon, 23 Dec 2013 21:04:46 +0000 (16:04 -0500)] 
debugfs, e2fsck: fix s_desc_size handling

The s_desc_size in the superblock specifies the group descriptor
size in bytes, but in various places the EXT4_FEATURE_INCOMPAT_64BIT
flag implies that the descriptor size is EXT2_MIN_DESC_SIZE_64BIT
(64 bytes) instead of checking the actual size.  In other places,
the s_desc_size field is used without checking for INCOMPAT_64BIT.

In the case of ext2fs_group_desc() the s_desc_size was being ignored,
and assumed to be sizeof(struct ext4_group_desc), which would result
in garbage for any but the first group descriptor.  Similarly, in
ext2fs_group_desc_csum() and print_csum() they assumed that the
maximum group descriptor size was sizeof(struct ext4_group_desc).
Fix these functions to use the actual superblock s_desc_size if
INCOMPAT_64BIT.

Conversely, in ext2fs_swap_group_desc2() s_desc_size was used
without checking for INCOMPAT_64BIT being set.

The e2fsprogs behaviour is different than that of the kernel,
which always checks INCOMPAT_64BIT, and only uses s_desc_size to
determine the offset of group descriptors and what range of bytes
to checksum.

Allow specifying the s_desc_size field at mke2fs time with the
"-E desc_size=NNN" option.  Allow a power-of-two s_desc_size
value up to s_blocksize if INCOMPAT_64BIT is specified.  This
is not expected to be used by regular users at this time, so it
is not currently documented in the mke2fs usage or man page.

Add m_desc_size_128, f_desc_size_128, and f_desc_bad test cases to
verify mke2fs and e2fsck handling of larger group descriptor sizes.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2fsck: verify s_desc_size is power-of-two value
Andreas Dilger [Mon, 23 Dec 2013 21:03:41 +0000 (16:03 -0500)] 
e2fsck: verify s_desc_size is power-of-two value

Add a LOG2_CHECK mode for check_super_value() so that it is easy
to verify values that are supposed to be power-of-two values
(s_desc_size and s_inode_size so far).  In ext2fs_check_desc()
also check for a power-of-two s_desc_size.

Print out s_desc_size in debugfs "stats" and dumpe2fs output, if
it is non-zero.

It turns out that the s_desc_size validation in check_super_block()
is not currently used by e2fsck, because the group descriptors are
verified earlier by ext2fs_check_desc(), and even without an
explicit check of s_desc_size the group descriptors fail to align
correctly on disk.  It makes sense to keep the check_super_block()
regardless, in case the code changes at some point in the future.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agotests: delete temporary resize test files
Andreas Dilger [Mon, 23 Dec 2013 21:01:51 +0000 (16:01 -0500)] 
tests: delete temporary resize test files

Since commit 5ad07acad if $TMP cannot hold large test filesystems
for resize testing the resize_test creates temporary test files
in the local working directory.  Since it overrides TMPFILE locally
the calling program does not delete the generated file correctly.

Delete the large $TMPFILE within resize_test if it passes, but leave
it for debugging if the test failed.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2fsck: read only parameter incorrectly compared
Johan Erlandsson [Thu, 19 Dec 2013 18:55:51 +0000 (13:55 -0500)] 
e2fsck: read only parameter incorrectly compared

Don't check for lost+found in read only mode.

[Note: this patch was originally made against 1.41.14 version of
e2fsprogs found as part of the AOSP (Android Open Source Program)
tree.  My Signed-off-by relies on the fact that the original patch
author would have had to have filed a contribution agreement with Open
Handset Alliance before this commit before this commit was allowed
into the AOSP tree. -- tytso]

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoClean up sparse warnings
Theodore Ts'o [Mon, 16 Dec 2013 23:56:36 +0000 (18:56 -0500)] 
Clean up sparse warnings

Mostly by adding static and removing excess extern qualifiers.  Also
convert a few remaining non-ANSI function declarations to ANSI.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2fsprogs: mke2fs manpage updates
Uri Corin [Mon, 16 Dec 2013 05:53:35 +0000 (00:53 -0500)] 
e2fsprogs: mke2fs manpage updates

I've added documentation for all available filesystem features
settable by mke2fs.
* Features now include the kernel constant attached to the function.
* Some pre-existing feature explanations have been expanded based on
ext4.wiki.kernel.org.

[ Edited by tytso for stylistic and correctness. ]

Addresses-Debian-Bug: #586218

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agomke2fs: disallow creating FS on a loop mounted file with no option
Kazuya Mio [Mon, 16 Dec 2013 05:48:12 +0000 (00:48 -0500)] 
mke2fs: disallow creating FS on a loop mounted file with no option

When /etc/mtab is a symlink of /proc/mounts, mke2fs without -FF option
can create a filesystem on the image file that is mounted.
According to mke2fs man page, we should specify -FF option in this case.

This patch protects filesystem from unintended mke2fs caused by human error.

How to reproduce:
  # mke2fs -t ext4 -Fq fs.img
  # mount -o loop fs.img /mnt/mp1
  # mke2fs -t ext4 -Fq fs.img && echo "mke2fs success"
  mke2fs success

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agomke2fs: fix force option to create filesystem on mounted device
Kazuya Mio [Mon, 16 Dec 2013 05:42:22 +0000 (00:42 -0500)] 
mke2fs: fix force option to create filesystem on mounted device

According to mke2fs man, we can create a filesystem on the mounted
device when -FF option is specified.

However, currently we have to specify -F option third to force mke2fs.
This patch fixes the problem.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2fsck: try implied cluster allocation when expanding a dir
Darrick J. Wong [Mon, 16 Dec 2013 04:54:07 +0000 (23:54 -0500)] 
e2fsck: try implied cluster allocation when expanding a dir

When we're expanding a directory, check to see if we're doing an
implied cluster allocation; if so, we don't need to allocate a new
block, and we certainly don't need to update the summary counts.

Reported-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2fsck: print cluster ranges when encountering bitmap errors
Darrick J. Wong [Mon, 16 Dec 2013 04:53:32 +0000 (23:53 -0500)] 
e2fsck: print cluster ranges when encountering bitmap errors

If pass5 finds bitmap errors in a range of clusters, don't print each
cluster number individually when we could print only the start and end
cluster number.  e2fsck already does this for the non-bigalloc case.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2fsck: only release clusters when shortening a directory during a rehash
Darrick J. Wong [Wed, 11 Dec 2013 01:23:12 +0000 (17:23 -0800)] 
e2fsck: only release clusters when shortening a directory during a rehash

When the rehash process is running on a bigalloc filesystem, it
compresses all the directory entries and hash structures into the
beginning of the directory file and then uses block_iterate3() to free
the blocks off the end of the file.  It seems to call
ext2fs_block_alloc_stats2() for every block in a cluster, which is
unfortunate because this function allocates and frees entire clusters
(and updates the summary counts accordingly).  In this case e2fsck
writes out incorrect summary counts.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: don't update the summary counts when doing implied cluster allocation
Darrick J. Wong [Mon, 16 Dec 2013 04:50:52 +0000 (23:50 -0500)] 
libext2fs: don't update the summary counts when doing implied cluster allocation

When we're appending a block to a directory file or the journal file,
and the new block is part of a cluster that has already been allocated
to the file (implied cluster allocation), don't update the bitmap or
the summary counts because that was performed when the cluster was
allocated.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: only punch complete clusters
Darrick J. Wong [Mon, 16 Dec 2013 04:50:03 +0000 (23:50 -0500)] 
libext2fs: only punch complete clusters

When bigalloc is enabled, using ext2fs_block_alloc_stats2() to free
any block in a cluster has the effect of freeing the entire cluster.
This is problematic if a caller instructs us to punch, say, blocks
12-15 of a 16-block cluster, because blocks 0-11 now point to a "free"
cluster.

The naive way to solve this problem is to see if any of the other
blocks in this logical cluster map to a physical cluster.  If so, then
we know that the cluster is still in use and it mustn't be freed.
Otherwise, we are punching the last mapped block in this cluster, so
we can free the cluster.

The implementation given only does the rigorous checks for the partial
clusters at the beginning and end of the punching range.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoext2fs,blkid: delete unused LIST_HEAD() macro
Andreas Dilger [Mon, 16 Dec 2013 04:26:38 +0000 (23:26 -0500)] 
ext2fs,blkid: delete unused LIST_HEAD() macro

The LIST_HEAD() macro conflicts with the <sys/queue.h> declaration
of the same name.  Delete the unused LIST_HEAD() macro from the
libext2fs and libblkid headers to avoid compiler warnings.  It can
be replaced by INIT_LIST_HEAD() or LIST_HEAD_INIT() if needed.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoext2fs: quiet compiler warnings
Andreas Dilger [Mon, 16 Dec 2013 04:26:25 +0000 (23:26 -0500)] 
ext2fs: quiet compiler warnings

Include ext2fsP.h in fileio.c for ext2fs_file_block_offset_too_big()
declaration.  Fix up the declaration to mark it extern in the header.

Include <strings.h> header for strcasecmp() in tune2fs.c if available,
as described in the strcasecmp(3) man page, instead of doing this
indirectly by declaring _BSD_SOURCE and getting it from <string.h>.

If CONFIG_QUOTA is undefined, parse_quota_opts() is unused in
tune2fs.c so #ifdef it out.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs: clean up debugfs man page and help text
Andreas Dilger [Mon, 16 Dec 2013 03:12:43 +0000 (22:12 -0500)] 
debugfs: clean up debugfs man page and help text

Clean up the formatting of the debugfs(8) man page:
- add command aliases to the main descriptions
- use bold for sub-commands and italics for their arguments
- remove trailing spaces
- add "dirty" sub-command
- clarify "block_dump" and "zap_block" sub-commands

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agobuild: quiet LLVM non-literal string format warning
Andreas Dilger [Mon, 16 Dec 2013 03:11:40 +0000 (22:11 -0500)] 
build: quiet LLVM non-literal string format warning

Compiling with LLVM generates a large number of warnings due
to the use of _() for wrapping strings for i18n:

    warning: format string is not a string literal
          (potentially insecure) [-Wformat-security]
    ./nls-enable.h:4:14: note: expanded from macro '_'
    #define _(a) (gettext (a))
                 ^~~~~~~~~~~~

These warnings are fixed by using "%s" as the format string,
and then _() is used as the string argument.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agobuild: use long long for __u64 by default
Andreas Dilger [Mon, 16 Dec 2013 03:09:24 +0000 (22:09 -0500)] 
build: use long long for __u64 by default

Don't print a verbose configure error in parse-types.h if
<asm/types.h> missing and __[SU]*_TYPEDEF is unset.  This is
always the case for non-Linux builds.

The printf formatting strings all use "%llu" for printing 64-bit
values and this it produces a large number of warnings if __u64
is defined as "unsigned long".  If __U64_TYPEDEF isn't set use
"unsigned long long" for __u64 in ext2-types.h and blkid-types.h
by default instead of using "unsigned long".

Fix a few places where "%d" or "%u" or "%Lu" were used to print a
64-bit value, by converting them to use "%lld" or "%llu" instead.

Fix a few places where "%lu" was used to print .tv_usec, by casting
the variable to "(long)" since .tv_usec is "int" on some systems.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agotune2fs: forbid changing uuid on an uninit_bg filesystem
Darrick J. Wong [Sun, 15 Dec 2013 01:51:04 +0000 (20:51 -0500)] 
tune2fs: forbid changing uuid on an uninit_bg filesystem

The old uninit_bg checksums depend on the UUID, so prohibit changes to
the UUID if a checksumming filesystem is mounted, because this
introduces a nasty race where the kernel and tune2fs are both trying
to rewrite group descriptors at the same time, with different ideas
about what the UUID is.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: use ext2fs_punch() to truncate quota file
Darrick J. Wong [Sun, 15 Dec 2013 00:52:40 +0000 (19:52 -0500)] 
libext2fs: use ext2fs_punch() to truncate quota file

Use the new ext2fs_punch() call to truncate the quota file.  This also
eliminates the need to fix it to work with bigalloc.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: clamp block-map punch range end to 2^32 blocks
Darrick J. Wong [Sun, 15 Dec 2013 00:46:50 +0000 (19:46 -0500)] 
libext2fs: clamp block-map punch range end to 2^32 blocks

In the ^extent case, passing ~0ULL as the 'end' parameter to
ext2fs_punch() causes the (end - start + 1) calculation to overflow to
zero.  Since the old-style mapped block files cannot have more than
2^32 blocks, just clamp it to ~0U.

This fixes a regression in t_quota_2off with the patch "libext2fs: use
ext2fs_punch() to truncate quota file" applied.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: zero block contents past EOF when setting size
Darrick J. Wong [Thu, 12 Dec 2013 18:31:35 +0000 (13:31 -0500)] 
libext2fs: zero block contents past EOF when setting size

When we set the file size, find the block containing EOF, and zero
everything in that block past EOF so that we can't return stale data
if we ever use fallocate or truncate to lengthen the file.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2fsck: in rehash, mark newly allocated extent blocks as found
Darrick J. Wong [Wed, 11 Dec 2013 01:22:07 +0000 (17:22 -0800)] 
e2fsck: in rehash, mark newly allocated extent blocks as found

When we're rehashing directories, it's possible that an extent block
(or a map block) could be (silently) allocated by the underlying
libext2fs when expanding the directory.  This silent allocation is not
captured in block_found_map, which is disastrous if later the rehash
process expands another directory and uses that same block from
before without realizing that it's now in use.

Therefore, if we notice that the free block count has dropped by more
than what e2fsck allocated itself during the expansion, we iterate the
directory's blocks a second time to ensure that these silent
allocations are marked in the found blocks bitmap.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: don't error out when punching a totally sparse file
Darrick J. Wong [Thu, 12 Dec 2013 18:25:40 +0000 (13:25 -0500)] 
libext2fs: don't error out when punching a totally sparse file

If we're asked to punch a file with no data blocks mapped to it and a
non-zero length, we don't need to do any work in ext2fs_punch_extent()
and can return success.  Unfortunately, the extent_get() function
returns "no current node" because it (correctly) failed to find any
extents, which is bubbled up to callers.  Since no extents being found
is not an error in this corner case, fix up ext2fs_punch_extent() to
return 0 to callers.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: fix punching extents when there are no left extents
Darrick J. Wong [Thu, 12 Dec 2013 18:23:51 +0000 (13:23 -0500)] 
libext2fs: fix punching extents when there are no left extents

When deleting an entire extent, we cannot always slip to the previous
leaf extent because there might not /be/ a previous extent.
Attempting to correct for that error by asking for the 'current' leaf
extent also doesn't work, because the failed attempt to change to the
previous extent leaves us with no current extent.

Fix this problem by recording the lblk of the next extent before
deleting the current extent and _goto()ing to the next extent after
the deletion.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: fail fileio write if we can't allocate a block
Darrick J. Wong [Thu, 12 Dec 2013 18:19:46 +0000 (13:19 -0500)] 
libext2fs: fail fileio write if we can't allocate a block

If we're using ext2fs_file_write() to write to a hole in a file,
ensure that we can actually allocate the block before updating i_size.
In other words, don't update i_size and don't return success if we hit
an error while allocating space.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: fix a broken close() test
Darrick J. Wong [Thu, 12 Dec 2013 18:17:58 +0000 (13:17 -0500)] 
libext2fs: fix a broken close() test

Zero is a valid file descriptor, so close it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: fix memory leaks (on error paths)
Darrick J. Wong [Wed, 11 Dec 2013 01:21:34 +0000 (17:21 -0800)] 
libext2fs: fix memory leaks (on error paths)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: check return values
Darrick J. Wong [Thu, 12 Dec 2013 18:14:50 +0000 (13:14 -0500)] 
libext2fs: check return values

Fix up a few places where we ignore return values.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibquota: fix memory leak (on error path)
Darrick J. Wong [Thu, 12 Dec 2013 18:13:51 +0000 (13:13 -0500)] 
libquota: fix memory leak (on error path)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibss: fix memory handling errors
Darrick J. Wong [Thu, 12 Dec 2013 18:12:09 +0000 (13:12 -0500)] 
libss: fix memory handling errors

Fix memory allocation calculations and check for NULL pointer returns.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibss: fix fd error handling
Darrick J. Wong [Thu, 12 Dec 2013 18:11:06 +0000 (13:11 -0500)] 
libss: fix fd error handling

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodumpe2fs: check return values
Darrick J. Wong [Thu, 12 Dec 2013 18:10:29 +0000 (13:10 -0500)] 
dumpe2fs: check return values

Check the return values from ext2fs_get_block_bitmap_range2(); if an
error happened, print that and don't print garbage bitmap.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2image: check return value from check_if_mounted()
Darrick J. Wong [Thu, 12 Dec 2013 18:09:22 +0000 (13:09 -0500)] 
e2image: check return value from check_if_mounted()

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe4defrag: defensively check results of sysconf(_SC_PAGESIZE)
Darrick J. Wong [Thu, 12 Dec 2013 18:08:45 +0000 (13:08 -0500)] 
e4defrag: defensively check results of sysconf(_SC_PAGESIZE)

sysconf(_SC_PAGESIZE) will probably never return an error, but just in
case it does, we shouldn't pass what looks like a huge number to
sync_file_range() and posix_fadvise().

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe4defrag: don't crash if umounts the filesystem races with us
Darrick J. Wong [Thu, 12 Dec 2013 18:07:33 +0000 (13:07 -0500)] 
e4defrag: don't crash if umounts the filesystem races with us

If someone umounts the filesystem between statfs64() and the getmntent()
iteration, we can exit the loop having never set mnt_type, and strcmp
can crash.  Fix the potential NULL dereference.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agomke2fs: don't leak memory (on error path)
Darrick J. Wong [Thu, 12 Dec 2013 18:06:44 +0000 (13:06 -0500)] 
mke2fs: don't leak memory (on error path)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agomisc: don't leak file descriptors (on error paths)
Darrick J. Wong [Thu, 12 Dec 2013 18:05:50 +0000 (13:05 -0500)] 
misc: don't leak file descriptors (on error paths)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2fsck: fix memory leaks (on error path)
Darrick J. Wong [Thu, 12 Dec 2013 17:57:48 +0000 (12:57 -0500)] 
e2fsck: fix memory leaks (on error path)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs: don't leak mmp_s memory (on error path)
Darrick J. Wong [Thu, 12 Dec 2013 17:52:00 +0000 (12:52 -0500)] 
debugfs: don't leak mmp_s memory (on error path)

ext2fs_free_mem() takes a pointer to a pointer, similar to
ext2fs_get_mem().  Improve the documentation, and fix debugfs.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs: don't leak fd when calling dump_file
Darrick J. Wong [Thu, 12 Dec 2013 17:50:58 +0000 (12:50 -0500)] 
debugfs: don't leak fd when calling dump_file

The caller of dump_file provides a fd to write to, so the caller
should also dispose of the fd.  Also, the fd never gets closed if
preserve=1.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: fileio should use 64bit io routines
Darrick J. Wong [Thu, 12 Dec 2013 17:50:04 +0000 (12:50 -0500)] 
libext2fs: fileio should use 64bit io routines

When reading or writing file blocks, use the IO manager routines that
can handle 64bit block numbers.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs: handle 64bit block numbers
Darrick J. Wong [Thu, 12 Dec 2013 17:49:14 +0000 (12:49 -0500)] 
debugfs: handle 64bit block numbers

debugfs should use strtoull wrappers for reading block numbers from
the command line.  "unsigned long" isn't wide enough to handle block
numbers on 32bit platforms.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: make symlinks safe for 64bit blocks and extents
Darrick J. Wong [Thu, 12 Dec 2013 17:48:33 +0000 (12:48 -0500)] 
libext2fs: make symlinks safe for 64bit blocks and extents

If we have to create a big symlink (i.e. one that doesn't fit into
i_block[]), we are not 64bit block safe and the namei code does not
handle extents at all.  Fix both.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs: fix various minor bogosity
Darrick J. Wong [Thu, 12 Dec 2013 17:43:36 +0000 (12:43 -0500)] 
debugfs: fix various minor bogosity

We should really use the ext2fs memory allocator functions in
copy_file(), and we really should return a value if there's allocation
problems.

Also fix up a minor bogosity in an error message.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Cc: Robert Yang <liezhi.yang@windriver.com>
Cc: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: fix "a" vs "an" in the error catalog
Darrick J. Wong [Thu, 12 Dec 2013 17:41:58 +0000 (12:41 -0500)] 
libext2fs: fix "a" vs "an" in the error catalog

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: don't allow ridiculously large logical block numbers
Darrick J. Wong [Thu, 12 Dec 2013 17:40:31 +0000 (12:40 -0500)] 
libext2fs: don't allow ridiculously large logical block numbers

Forbid clients from trying to map logical block numbers that are
larger than the lblk->pblk data structures are capable of handling.
While we're at it, don't let clients set the file size to a number
that's beyond what can be mapped.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs: fix init_filesys help text
Darrick J. Wong [Thu, 12 Dec 2013 17:29:07 +0000 (12:29 -0500)] 
debugfs: fix init_filesys help text

The help text for debugfs' init_filesys command is incorrect; the
second parameter is the size of the filesystem in blocks, not the size
of an individual filesystem block.  There is in fact no way to set
that parameter.

Reported-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agomke2fs: load configfile blocksize setting before 64bit checks
Darrick J. Wong [Wed, 11 Dec 2013 01:18:37 +0000 (17:18 -0800)] 
mke2fs: load configfile blocksize setting before 64bit checks

mke2fs has a series of checks to ensure that we don't create a
filesystem too big for its blocksize -- if auto-64bit is on, then it
turns on 64bit; otherwise it complains.  Unfortunately, it performs
these checks before looking in mke2fs.conf for a blocksize, which
means that the checks are incorrect if the user specifies a non-4096
blocksize in the config file and says nothing on the command line.
The bug also has the effect of mandating a 4k block size on any block
device larger than 4T in that situation.  Therefore, read the block
size from the config file before performing the 64bit checks.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: fix tests that set LARGE_FILE
Darrick J. Wong [Wed, 11 Dec 2013 01:18:27 +0000 (17:18 -0800)] 
libext2fs: fix tests that set LARGE_FILE

For each site where we test for a large file (> 2GB) and set the
LARGE_FILE feature, use a helper function to make the size test
consistent with the test that's in e2fsck.  This fixes the fsck
complaints when we try to create a 2GB journal (not so hard with 64k
block size) and fixes the incorrect test in fileio.c.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agolibext2fs: don't overflow when punching indirect blocks with large blocks
Darrick J. Wong [Thu, 12 Dec 2013 17:06:03 +0000 (12:06 -0500)] 
libext2fs: don't overflow when punching indirect blocks with large blocks

On a FS with a rather large blockize (> 4K), the old block map
structure can construct a fat enough "tree" (or whatever we call that
lopsided thing) that (at least in theory) one could create mappings
for logical blocks higher than 32 bits.  In practice this doesn't
happen, but the 'max' and 'iter' variables that the punch helpers use
will overflow because the BLOCK_SIZE_BITS shifts are too large to fit
a 32-bit variable.  The current variable declarations also cause punch
to fail on TIND-mapped blocks even if the file is < 16T.  So enlarge
the fields to fit.

Yes, this is an obscure corner case, but it seems a little silly if we
can't punch a file's block 300,000,000 on a 64k-block filesystem.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoe2fsck: fix problem comments to match actual message
Andreas Dilger [Thu, 12 Dec 2013 01:10:39 +0000 (20:10 -0500)] 
e2fsck: fix problem comments to match actual message

Fix the e2fsck problem comments to match the actual message printed,
so that it is possible to find the problem code when searching by
the message.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agoUpdate config.{guess,sub} to the latest version
Theodore Ts'o [Wed, 11 Dec 2013 04:12:38 +0000 (23:12 -0500)] 
Update config.{guess,sub} to the latest version

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 years agodebugfs: update usage message for open and filefrag
Zheng Liu [Mon, 9 Dec 2013 02:01:09 +0000 (21:01 -0500)] 
debugfs: update usage message for open and filefrag

The ussage message for the open and filefrag commands were missing
options; this commit fixes this.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>