Whamcloud - gitweb
tools/e2fsprogs.git
11 years agoblkid: fix blkid -o list formatting with columns > 160
Theodore Ts'o [Sat, 11 Jan 2014 04:25:54 +0000 (23:25 -0500)]
blkid: fix blkid -o list formatting with columns > 160

This bug is also in the util-linux version of blkid.

Addresses-Coverity-Id: #1049158

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibblkid: add error checking for rename() while saving the blkid cache
Theodore Ts'o [Sat, 11 Jan 2014 03:09:45 +0000 (22:09 -0500)]
libblkid: add error checking for rename() while saving the blkid cache

Addresses-Coverity-Id: #1049141

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibblkid: fix integer width issue in probe_fat
Theodore Ts'o [Sat, 11 Jan 2014 02:56:29 +0000 (21:56 -0500)]
libblkid: fix integer width issue in probe_fat

Addresses-Coverity-Id: #1049162

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibblkid: remove unneeded pointer checks
Theodore Ts'o [Sat, 11 Jan 2014 02:53:08 +0000 (21:53 -0500)]
libblkid: remove unneeded pointer checks

Addresses-Coverity-Id: #207522
Addresses-Coverity-Id: #207523

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoblkid: fix gcc -Wall nits
Theodore Ts'o [Sat, 11 Jan 2014 02:40:28 +0000 (21:40 -0500)]
blkid: fix gcc -Wall nits

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agomke2fs, tune2fs: remove unneeded access() call
Theodore Ts'o [Sat, 11 Jan 2014 02:39:27 +0000 (21:39 -0500)]
mke2fs, tune2fs: remove unneeded access() call

Addresses-Coverity-Id: #709536
Addresses-Coverity-Id: #709535

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibss: fix potential null dereference if realloc() fails
Theodore Ts'o [Sat, 11 Jan 2014 02:13:15 +0000 (21:13 -0500)]
libss: fix potential null dereference if realloc() fails

Addresses-Coverity-Id: #1153630

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibuuid: add error checking to syscalls in get_clock()
Theodore Ts'o [Sat, 11 Jan 2014 02:06:07 +0000 (21:06 -0500)]
libuuid: add error checking to syscalls in get_clock()

Also remove redundant close() of state_fd, since the fclose() of
state_f will result in the fd being closed.

Addresses-Coverity-Id: #1049146
Addresses-Coverity-Id: #26092

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoutil: fix make dependencies for subst
Theodore Ts'o [Thu, 9 Jan 2014 20:59:29 +0000 (15:59 -0500)]
util: fix make dependencies for subst

Now that subst is using config.h, we need to fix its dependencies so
that if config.h is missing (i.e., after a "make clean" in the tree)
that it is rebuilt by the Makefile rule.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoSave and restore umask around calls to mkstemp()
Theodore Ts'o [Thu, 9 Jan 2014 20:18:44 +0000 (15:18 -0500)]
Save and restore umask around calls to mkstemp()

The races would be hard to exploit, but let's close them off.

Addresses-Coverity-Id: #709504
Addresses-Coverity-Id: #709505
Addresses-Coverity-Id: #709506

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibuuid: check return value of uuid_parse() in test
Theodore Ts'o [Thu, 9 Jan 2014 20:06:50 +0000 (15:06 -0500)]
libuuid: check return value of uuid_parse() in test

Addresses-Coverity-Id: #709477

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoblkid: add fallthrough comment
Theodore Ts'o [Thu, 9 Jan 2014 20:03:40 +0000 (15:03 -0500)]
blkid: add fallthrough comment

Addresses-Coverity-Id: #709484

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibblkid: clean up some integer promotion / signed issues
Theodore Ts'o [Thu, 9 Jan 2014 19:56:54 +0000 (14:56 -0500)]
libblkid: clean up some integer promotion / signed issues

Addresses-Coverity-Id: #1049165
Addresses-Coverity-Id: #1049164
Addresses-Coverity-Id: #1049163
Addresses-Coverity-Id: #1049162
Addresses-Coverity-Id: #709508
Addresses-Coverity-Id: #709507

11 years agodebugfs: fix typo in commit 5a1d25a7b
Theodore Ts'o [Thu, 9 Jan 2014 19:30:43 +0000 (14:30 -0500)]
debugfs: fix typo in commit 5a1d25a7b

The typo causes a compiler warning, but it's otherwise harmless.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoFix up workarounds for dietlibc breakage
Theodore Ts'o [Thu, 9 Jan 2014 03:25:04 +0000 (22:25 -0500)]
Fix up workarounds for dietlibc breakage

The dietlibc doesn't support the TZ environment variable, which is
required by the standard.  Work around this so that we can run the
regression test suite when building with dietlibc.  (This is useful
for finding problems.)

With this change, the only thing which doesn't work as far as dietlibc
is concerned is the posix_memalign test, and the MMP support tests
(because posix_memalign isn't provided by dietlibc, sigh.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibss: fix memory leak if realloc() fails in ss_parse()
Theodore Ts'o [Tue, 7 Jan 2014 14:36:49 +0000 (09:36 -0500)]
libss: fix memory leak if realloc() fails in ss_parse()

Addresses-Coverity-Id: #709491

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agobadblocks: print warning if set_o_direct() fails
Theodore Ts'o [Tue, 7 Jan 2014 14:18:19 +0000 (09:18 -0500)]
badblocks: print warning if set_o_direct() fails

Addresses-Coverity-Id: #1049148

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agodebugfs: remove dead code
Theodore Ts'o [Tue, 7 Jan 2014 14:08:05 +0000 (09:08 -0500)]
debugfs: remove dead code

Addresses-Coverity-Id: #1138573

Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibext2fs: fix memory leaks on error paths in ext2fs_create_icount_tdb
Theodore Ts'o [Tue, 7 Jan 2014 14:05:03 +0000 (09:05 -0500)]
libext2fs: fix memory leaks on error paths in ext2fs_create_icount_tdb

Addresses-Coverity-Id: #1138575

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibquota: add error checking to quota_remove_inode
Theodore Ts'o [Tue, 7 Jan 2014 06:00:49 +0000 (01:00 -0500)]
libquota: add error checking to quota_remove_inode

Addresses-Coverity-Id: #709475

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibquota: add error checking to quota_write_inode()
Theodore Ts'o [Tue, 7 Jan 2014 05:55:02 +0000 (00:55 -0500)]
libquota: add error checking to quota_write_inode()

Addresses-Coverity-Id: #709476

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibext2fs: remove redundant code in rb_print_stats()
Theodore Ts'o [Tue, 7 Jan 2014 05:50:05 +0000 (00:50 -0500)]
libext2fs: remove redundant code in rb_print_stats()

Addresses-Coverity-Id: #709550

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoe2fsck: fix memory leak on error path in read_bad_blocks_files()
Theodore Ts'o [Tue, 7 Jan 2014 05:47:40 +0000 (00:47 -0500)]
e2fsck: fix memory leak on error path in read_bad_blocks_files()

Addresses-Coverity-Id: #1049170

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibext2fs: make ext2fs_group_desc_csum return 0 if meta_csum not enabled
Theodore Ts'o [Tue, 7 Jan 2014 05:41:50 +0000 (00:41 -0500)]
libext2fs: make ext2fs_group_desc_csum return 0 if meta_csum not enabled

Addresses-Coverity-Id: #1147784

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoe2fsck: release allocated memory on error or abort in e2fsck_pass1()
Theodore Ts'o [Tue, 7 Jan 2014 05:39:19 +0000 (00:39 -0500)]
e2fsck: release allocated memory on error or abort in e2fsck_pass1()

Addresses-Coverity-Id: #1148450

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibss: fix potential memory leak on realloc() failure
Theodore Ts'o [Tue, 7 Jan 2014 03:20:38 +0000 (22:20 -0500)]
libss: fix potential memory leak on realloc() failure

Commit 191a03ac5f was an incorrect fix for this issue.  Fix it up.

Addresses-Coverity-ID: #295143
Addresses-Coverity-ID: #1148451

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoe2fsck: add error checking when moving the quota inode
Theodore Ts'o [Mon, 6 Jan 2014 01:31:18 +0000 (20:31 -0500)]
e2fsck: add error checking when moving the quota inode

Addresses-Coverity-Bug: #1049140

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibblkid: fix memory overrun in probe_lvm2
Theodore Ts'o [Sun, 5 Jan 2014 06:12:49 +0000 (01:12 -0500)]
libblkid: fix memory overrun in probe_lvm2

Addresses-Coverity-ID: #1049167

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agotest_extents: fix a possible memory leak
Theodore Ts'o [Sun, 5 Jan 2014 06:12:49 +0000 (01:12 -0500)]
test_extents: fix a possible memory leak

Addresses-Coverity-Bug: #1049185

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibext2fs: fix potential memory leak in qcow2_write_raw_image()
Theodore Ts'o [Sun, 5 Jan 2014 06:12:49 +0000 (01:12 -0500)]
libext2fs: fix potential memory leak in qcow2_write_raw_image()

Addresses-Coverity-ID: #1049179
Addresses-Coverity-ID: #1049180

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibss: fix potential memory leak on realloc() failure
Theodore Ts'o [Sun, 5 Jan 2014 06:12:48 +0000 (01:12 -0500)]
libss: fix potential memory leak on realloc() failure

Addresses-Coverity-ID: #295143

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agodebian: renable use of internal uuid and blkid libraries for e2fsck.static
Theodore Ts'o [Sun, 5 Jan 2014 06:09:07 +0000 (01:09 -0500)]
debian: renable use of internal uuid and blkid libraries for e2fsck.static

Now that the diet libc support is working again, we need to use the
internal uuid and blkid library in order for e2fsck.static to be
compiled properly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoUse consistent e2fsprogs-standard types
Theodore Ts'o [Sun, 5 Jan 2014 05:15:54 +0000 (00:15 -0500)]
Use consistent e2fsprogs-standard types

Some different types such as u_int16_t and __uint32_t have snuck into
e2fsprogs.  These types are not guaranteed by any standard, and they
are not provided by dietlibc.  Convert them to __u16, __u32,
etc. since these are guaranteed to be provided by e2fsprogs' build.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoconfigure: fix --with-diet-libc
Theodore Ts'o [Sun, 5 Jan 2014 01:44:29 +0000 (20:44 -0500)]
configure: fix --with-diet-libc

Newer versions of autoconf pull in AC_PROG_GCC as part of
AC_CANONICAL_HOST.  So we need check for WITH_DIET_LIBC earlier in
configure.in.

Also, e2fsprogs now needs functions which are found in diet libc's
compat library.  So add support for autoconf's LIBS function, and
automatically set libs to include -lcompat.

Finally, disable compiling e4defrag by deault if --with-diet-libc is
specified because the program has too many glibc dependencies.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoe4defrag: choose the best available posix_fadvise variant
Baruch Siach [Thu, 2 Jan 2014 18:05:37 +0000 (13:05 -0500)]
e4defrag: choose the best available posix_fadvise variant

Use posix_fadvise64() when available.  This allows 64bit offsets on
32bit systems.

[ Modified by tytso to try to use fadvise64() as well, and to remove
  the attempt to call the syscall directly, since because and
  complexities caused by required dummy arguments on some
  architectures, it's not worth the hair.  ]

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoe2fsck: fix possible double free when searching for config file
Theodore Ts'o [Fri, 3 Jan 2014 14:51:44 +0000 (09:51 -0500)]
e2fsck: fix possible double free when searching for config file

This happens if there is an error while scanning a directory for
config file fragments.  This is rarely used, which is why we didn't
notice this.

Addresses-Coverity-Bug: #1138576

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agodebugfs: clean up read_journal_block() to avoid Coverity complaint
Theodore Ts'o [Fri, 3 Jan 2014 14:39:33 +0000 (09:39 -0500)]
debugfs: clean up read_journal_block() to avoid Coverity complaint

The read_journal_block() function was needlessly complicated, which
made it harder to read/maintain, and it also tripped up Coverity.
Cleaning it up also avoided some signed/unsigned casts, and allows us
to avoid passing got back to the caller, since it wasn't needed.

Addresses-Coverity-Bug: #709539

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agosubst: clean up various coverity nits
Theodore Ts'o [Fri, 3 Jan 2014 05:26:43 +0000 (00:26 -0500)]
subst: clean up various coverity nits

Add appropriate error checking for all error returns, and only open
each file that we need to manipulate once, to avoid potential
time-of-check/time-of-use races.  (Not that this is likely for this
program, but the result is much more clean.)

We also preserve the atime in the case where the file has not changed.

Addresses-Coverty-Id: #709537
Addresses-Coverty-Id: #1049150
Addresses-Coverty-Id: #1049151

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agolibblkid: fix sizeof(foo) vs sizeof(*foo) malloc() bug
Theodore Ts'o [Fri, 3 Jan 2014 02:54:03 +0000 (21:54 -0500)]
libblkid: fix sizeof(foo) vs sizeof(*foo) malloc() bug

Addresses-Coverity-Bug: #709510

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
11 years agoe2image: avoid potential divide by zero
Theodore Ts'o [Fri, 3 Jan 2014 02:15:20 +0000 (21:15 -0500)]
e2image: avoid potential divide by zero

It's highly unlikely after five seconds that zero blocks would have
been written, but let's silence the Coverity warning.

Addresses-Coverity-ID: 1147780

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
11 years agoe2image: eliminate division by zero
Theodore Ts'o [Fri, 3 Jan 2014 02:04:01 +0000 (21:04 -0500)]
e2image: eliminate division by zero

Dividing a floating point number by zero is undefined in C.  It
happens to work with gcc/glibc, but it's not something that's
guaranteed.

Addresses-Coverity-ID: #1147781

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
11 years agoe2image: fix resource leak when running e2image -n
Theodore Ts'o [Fri, 3 Jan 2014 01:18:20 +0000 (20:18 -0500)]
e2image: fix resource leak when running e2image -n

Addresses-Coverity-ID: #1147783

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
11 years agoe2image: mark strings for internationalization
jon ernst [Tue, 31 Dec 2013 06:50:31 +0000 (01:50 -0500)]
e2image: mark strings for internationalization

Signed-off-by: Jon Ernst <jonernst07@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoe2fsck.conf: clarify man page's description of accept_time_fudge
Theodore Ts'o [Wed, 1 Jan 2014 04:18:44 +0000 (23:18 -0500)]
e2fsck.conf: clarify man page's description of accept_time_fudge

Addresses-Debian-Bug: #719189

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoe2fsck: improve the "superblock corrupt" message
Theodore Ts'o [Wed, 1 Jan 2014 04:02:44 +0000 (23:02 -0500)]
e2fsck: improve the "superblock corrupt" message

Previously, this message used 8193 as the example alternate
superblock.  But for most file systems, the backup superblock is
located at 32768 (since most file systems have a block size of 4k, and
not 1k).

Addresses-Debian-Bug: #719185

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agomke2fs: use [^]feature instead of just feature in the man page
Theodore Ts'o [Wed, 1 Jan 2014 03:53:52 +0000 (22:53 -0500)]
mke2fs: use [^]feature instead of just feature in the man page

Addresses-Debian-Bug: #719184

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agodebian: add mention of the badblocks program in the package description
Theodore Ts'o [Wed, 1 Jan 2014 03:34:52 +0000 (22:34 -0500)]
debian: add mention of the badblocks program in the package description

Addresses-Debian-Bug: #718725

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agomke2fs: add support to create the file system at an offset
Theodore Ts'o [Tue, 31 Dec 2013 04:03:09 +0000 (23:03 -0500)]
mke2fs: add support to create the file system at an offset

This can be useful when creating a disk image for virtual machines.

Addresses-Debian-Bug: #497984

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agoupdate config.h.in file to enable loopback mount detection
Theodore Ts'o [Tue, 31 Dec 2013 03:41:48 +0000 (22:41 -0500)]
update config.h.in file to enable loopback mount detection

Commit fbabd5c44c23 added loopback mount detection.  However, we
failed to update the config.h file, so the code wasn't actually
enabled.  Fix this oversight.

Addresses-Debian-Bug: #497984

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 years agotests: use the in-tree binaries in the test f_extent_oobounds
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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>