Commit Graph

4327 Commits (a25fffae5cbdb9349fa3c358c9714584e9de7b33)

Author SHA1 Message Date
Eric Whitney a25fffae5c 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>
2013-12-30 16:56:19 -05:00
Theodore Ts'o d7e6e97871 e2image: fix printf format type match
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-30 16:56:19 -05:00
Theodore Ts'o 7f2c7495e3 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>
2013-12-30 15:48:06 -05:00
Theodore Ts'o 036a84710d Update release notes, etc., for final 1.42.9 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-28 23:19:52 -05:00
Trần Ngọc Quân 7f196ef755 po: update vi.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-12-28 22:34:45 -05:00
Volkan Gezer 90ff6ed73f po: update tr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-12-28 22:34:45 -05:00
Göran Uddeborg bf9227f275 po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-12-28 22:34:45 -05:00
Jakub Bogusz ca9a0a7e33 po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-12-28 22:34:45 -05:00
Benno Schulenberg d2cc8e1f92 po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-12-28 22:34:45 -05:00
Samuel Thibault 69e73088c4 po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-12-28 22:34:45 -05:00
Philipp Thomas e9955e7164 po: update de.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-12-28 22:34:44 -05:00
Petr Pisar 13261f5180 po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-12-28 22:34:44 -05:00
Walter Garcia-Fontes 1b2c78749c po: update ca.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-12-28 22:34:44 -05:00
Theodore Ts'o d055089567 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>
2013-12-28 22:25:11 -05:00
Theodore Ts'o 2d8637b150 debugfs: document the lsdel command in the man page
Addresses-Debian-Bug: #731329

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-28 22:15:59 -05:00
Theodore Ts'o 9518b29727 mke2fs: clarify documentation about bigalloc in the man page
Addresses-Debian-Bug: #669730

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-28 17:57:25 -05:00
Theodore Ts'o becb01ce84 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>
2013-12-28 17:21:17 -05:00
Theodore Ts'o 886056bd39 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>
2013-12-28 17:09:10 -05:00
Theodore Ts'o 2929f9daed debian: update debian-policy conormance to 3.9.5
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-28 16:28:56 -05:00
Theodore Ts'o de3088402b gen-tarball: ignore all of the build* directories
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-28 15:57:29 -05:00
Theodore Ts'o b79e338d2c 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>
2013-12-28 15:40:56 -05:00
Theodore Ts'o c003f48b48 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>
2013-12-27 01:14:09 -05:00
Theodore Ts'o c8ee0d60fd 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>
2013-12-27 01:04:32 -05:00
Theodore Ts'o 212c994883 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>
2013-12-26 23:45:17 -05:00
Theodore Ts'o 9f90b2e632 tests: fix stray newline printed when running r_min_itable
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-26 00:37:09 -05:00
Theodore Ts'o 7fcaabf8e8 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>
2013-12-26 00:21:13 -05:00
Theodore Ts'o 737a88673d e2image: make sure all strings are marked for internationalization
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-26 00:21:13 -05:00
Theodore Ts'o 0155e77021 e2image: add -n option to show what blocks would have been written
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-26 00:21:13 -05:00
Theodore Ts'o 38c771d6dd e2image: add -c option to optimize file system copying for flash devices
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-26 00:21:13 -05:00
Theodore Ts'o aa2c743331 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>
2013-12-26 00:21:08 -05:00
Theodore Ts'o d28759b223 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>
2013-12-26 00:20:43 -05:00
Theodore Ts'o 80fe25a2d7 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>
2013-12-26 00:20:43 -05:00
Phillip Susi ecc859b281 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>
2013-12-26 00:20:43 -05:00
Phillip Susi c40c7ceffe 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>
2013-12-26 00:20:43 -05:00
Phillip Susi 22b83f6280 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>
2013-12-26 00:20:40 -05:00
Phillip Susi 6b5535f409 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>
2013-12-24 23:34:04 -05:00
Theodore Ts'o b3c2a63813 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>
2013-12-24 23:19:07 -05:00
Theodore Ts'o aafd361550 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>
2013-12-24 22:50:23 -05:00
Theodore Ts'o 45f143c20c 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>
2013-12-24 22:50:23 -05:00
Theodore Ts'o 3c22bf7e70 Add ext4 man page and update and clean up the other man pages
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-24 22:50:23 -05:00
Eric Whitney 32541fe4f9 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>
2013-12-24 22:50:23 -05:00
Eric Whitney a8263cab57 e2fsck: fix printf conversion specs in ea_refcount.c
Commit 130e961a6f 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>
2013-12-24 22:50:23 -05:00
Andreas Dilger b769aaec1a 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>
2013-12-24 22:50:23 -05:00
Andreas Dilger 2bc3041754 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>
2013-12-24 22:50:19 -05:00
Andreas Dilger 11d1116a7c 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>
2013-12-23 16:03:46 -05:00
Andreas Dilger fd5e00e1d0 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>
2013-12-23 16:01:56 -05:00
Johan Erlandsson e9a8c0c2d4 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>
2013-12-19 16:24:54 -05:00
Theodore Ts'o f404167dda 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>
2013-12-16 18:56:36 -05:00
Uri Corin 4727c67dc2 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>
2013-12-16 01:26:53 -05:00
Kazuya Mio fbabd5c44c 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>
2013-12-16 00:48:54 -05:00