Whamcloud - gitweb
tools/e2fsprogs.git
7 years agoresize2fs: fix crash when there is an ea block and no blocks to migrate
Theodore Ts'o [Wed, 10 Aug 2016 19:49:35 +0000 (15:49 -0400)]
resize2fs: fix crash when there is an ea block and no blocks to migrate

This fixes a bug introduced in 1.43 by commit fb47b94fffc: "resize2fs:
rewrite extent/dir/ea block checksums when migrating".  If there is an
extended attribute block and there are no blocks that need to migrate,
we will crash.

The bug was caused by a botched De Morgan's transformation.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolibext2fs: fix infinite loop if copying in an empty directory
Matthias Andree [Thu, 21 Jul 2016 23:20:10 +0000 (01:20 +0200)]
libext2fs: fix infinite loop if copying in an empty directory

In m_minrootdir, on FreeBSD 9.3, try_lseek_copy() fails on an empty file
because errcode is uninitialized and the while() loop never executes,
and the errcode garbage is returned.

Initialize errcode = 0 in try_lseek_copy() to avoid a "fail" result when
there was nothing to copy.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: update j_tail_sequence after recovery
Daeho Jeong [Wed, 6 Jul 2016 00:10:39 +0000 (09:10 +0900)]
e2fsck: update j_tail_sequence after recovery

When journal is released, s_sequence is set to j_tail_sequence.
But, currently, even if the recovery process is successfully completed,
the j_tail_sequence and, finally, s_sequence are never changed. By this,
when we repeat doing power-off the device suddenly and executing e2fsck
without full scan before mount, the s_sequence number will never change
and, in a very rare case, newly generated journal logs will be
surprisingly grafted to the old journal logs. In this case, out-of-date
metadata log can be replayed on the filesystem area and the filesystem
can be crashed unintentionally by journal recovery process. Therefore,
we need to update j_tail_sequence after recovery process is successfully
completed in e2fsck.

Youngjin had repeated this test and found the problem. With our test,
the filesystem crash occurred within 4 hours.

Signed-off-by: Youngjin Gil <youngjin.gil@samsung.com>
Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agofuse2fs: needs SYSLIBS
Gustavo Zacarias [Wed, 22 Jun 2016 23:58:53 +0000 (20:58 -0300)]
fuse2fs: needs SYSLIBS

It otherwise leads to build failure when using an unbundled libintl.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoUpdate configure script to reflect changes from commit 62bc243f1bf
Theodore Ts'o [Wed, 22 Jun 2016 03:16:39 +0000 (23:16 -0400)]
Update configure script to reflect changes from commit 62bc243f1bf

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2undo: fix endian issues
Eric Sandeen [Thu, 16 Jun 2016 22:51:04 +0000 (17:51 -0500)]
e2undo: fix endian issues

Two new e2undo issues exist in the latest release on big endian
machines.

From sparse check:

undo_io.c:157:26: warning: invalid assignment: |=
undo_io.c:157:26:    left side has type restricted __le32
undo_io.c:157:26:    right side has type int
undo_io.c:161:26: warning: invalid assignment: &=
undo_io.c:161:26:    left side has type restricted __le32
undo_io.c:161:26:    right side has type int

e2undo.c:211:16: warning: cast to restricted __le64
e2undo.c:211:16: warning: cast from restricted blk64_t
e2undo.c:212:16: warning: cast to restricted __le64
e2undo.c:212:16: warning: cast from restricted blk64_t

Addresses-RedHat-Bugzilla: 1344636
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebugfs: fix logdump to work on files > 2GB
Theodore Ts'o [Mon, 13 Jun 2016 01:42:47 +0000 (21:42 -0400)]
debugfs: fix logdump to work on files > 2GB

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agomisc: don't unconditionally install manual page for fuse2fs
Ingo Brückl [Thu, 9 Jun 2016 20:56:50 +0000 (16:56 -0400)]
misc: don't unconditionally install manual page for fuse2fs

Only install the manual page if fuse2fs itself will be installed.

Signed-off-by: Ingo Brückl <ib@wupperonline.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agofuse2fs: might need librt
Gustavo Zacarias [Thu, 9 Jun 2016 20:56:15 +0000 (16:56 -0400)]
fuse2fs: might need librt

It uses clock_gettime() which in older glibc versions is in librt.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoUpdate release notes, etc. for 1.43.1 release v1.43.1
Theodore Ts'o [Wed, 8 Jun 2016 19:45:26 +0000 (15:45 -0400)]
Update release notes, etc. for 1.43.1 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolibblkid: avoid DIOCGDINFO where missing.
Matthias Andree [Wed, 8 Jun 2016 18:26:38 +0000 (14:26 -0400)]
libblkid: avoid DIOCGDINFO where missing.

FreeBSD 11 will remove the DIOCGINFO ioctl(), so check if it is defined
before referencing it.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoRemove the last of behaviour-specific checks on EXT2_OS_LINUX
Theodore Ts'o [Tue, 7 Jun 2016 17:36:47 +0000 (13:36 -0400)]
Remove the last of behaviour-specific checks on EXT2_OS_LINUX

If there is a feature check, we can just depend on the feature check.
If it is something that can't be checked via a feature flag, then
instead of checking for EXT2_OS_LINUX, we should instead check for
*NOT* EXT2_OS_HURD. since HURD is the special case.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agotests: suppress use of libmagic when running the regression test suite
Theodore Ts'o [Tue, 7 Jun 2016 16:46:24 +0000 (12:46 -0400)]
tests: suppress use of libmagic when running the regression test suite

How libmagic will behave is not necessarily stable across different
operating systems of versions of libmagic (or the magic number
database).  So suppress it to avoid false test failures.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agotests: disable some tests for FreeBSD
Theodore Ts'o [Tue, 7 Jun 2016 15:52:25 +0000 (11:52 -0400)]
tests: disable some tests for FreeBSD

Unfortunately, FreeBSD doesn't support sparse files in their tmpfs,
and they generlaly don't mount a tmpfs on /tmp anyway.  As a result
certain tests will either OOM kill a FreeBSD (if tmpfs is in use) or
will take forever (if it is not in use).

So let's turn off some tests for FreeBSD (m_hugefile is disabled on
MacOS already, for similar reasons).  We need to find a better
solution in the long term, but for now, these tests are guaranteed to
be a disaster on FreeBSD, so suppress them for now.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agotune2fs,resize2fs: special case HURD only when testing s_creator_os
Theodore Ts'o [Tue, 7 Jun 2016 15:47:40 +0000 (11:47 -0400)]
tune2fs,resize2fs: special case HURD only when testing s_creator_os

The s_creator_os field was a mistake, given how Hurd has been
ab(using) certain file system fields.  We should skip support for
certain advanced features (64-bit support, metadata checksums) for
file systems created on the Hurd OS only, instead of only supporting
them for file systems created on Linux.  This fixes various regression
test failures for FreeBSD.

(The regression tests are probably mostly hopeless for Hurd anyway,
but given the HURD abuse's of various file system fields, the HURD is
going to have to be given second-class treatment in any case, given
what they decided to do with ext2 support, which locks them out of the
more advanced file system features, anyway.)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolibext2fs: fix EXT2FS_PRETEND_* on non-Linux systems
Theodore Ts'o [Tue, 7 Jun 2016 15:44:54 +0000 (11:44 -0400)]
libext2fs: fix EXT2FS_PRETEND_* on non-Linux systems

The debugging environment variables EXT2FS_PRETEND_* were implemented
in check_mntent_file(), and this function isn't called on all
operating systems.  Lift this code up to ext2fs_check_mount_point(),
so that these environment variables (which are used in the regression
test suite) will work on all platforms.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoFix dbg_print() format for unsigned long long.
Matthias Andree [Tue, 7 Jun 2016 14:50:12 +0000 (10:50 -0400)]
Fix dbg_print() format for unsigned long long.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agotests: teach test_script the --failed option
Theodore Ts'o [Tue, 7 Jun 2016 14:47:20 +0000 (10:47 -0400)]
tests: teach test_script the --failed option

Teach test_script the --failed option, which asks it to rerun the
tests that had previously failed.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolibext2fs: don't use $(LDFLAGS_STATIC) when linking test programs
Theodore Ts'o [Tue, 7 Jun 2016 04:16:17 +0000 (00:16 -0400)]
libext2fs: don't use $(LDFLAGS_STATIC) when linking test programs

The tst_* progams aren't intended to be linked 100% stically; they
just link against some of the static libraries.  So use $(ALL_LDFLAGS)
and not $(LDFLAGS_STATIC).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoconfigure: fix detection of dlopen() for BSD systems
Theodore Ts'o [Tue, 7 Jun 2016 04:14:35 +0000 (00:14 -0400)]
configure: fix detection of dlopen() for BSD systems

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoMerge branch 'maint' into next
Theodore Ts'o [Tue, 7 Jun 2016 05:01:22 +0000 (01:01 -0400)]
Merge branch 'maint' into next

7 years agolibext2fs: fix Direct I/O fallback code so it implements RMW correctly
Theodore Ts'o [Tue, 7 Jun 2016 03:04:43 +0000 (23:04 -0400)]
libext2fs: fix Direct I/O fallback code so it implements RMW correctly

There is a bug in Unix I/O manager where if an aligned I/O is
required, it does not correctly do the read-modify-write cycle
correctly.  Specifically, it was not doing an lseek between the read
and the write calls, so the update was going to block N+1 instead of
block N.  Oops.

Fortunately in practice we almost never use this fallback path, so
file systems weren't getting horribly corrupted, because (a) we almost
never use Direct I/O in e2fsprogs, at least not by default, and (b)
when we do the buffers end up being aligned anyway, so it's OK.

We only noticed this because the new Undo I/O manager in e2fsprogs
1.43 was doing unaligned I/O and FreeBSD requires that I/O requests be
aligned even if you are not doing Direct I/O, and the e2undo
regression tests were all failing as a result.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agotests,debugfs: ea_set's "-f <value_file" needs to be before the other args
Theodore Ts'o [Mon, 6 Jun 2016 20:49:37 +0000 (16:49 -0400)]
tests,debugfs: ea_set's "-f <value_file" needs to be before the other args

For systems that don't use GNU's getopt(3), options have to be before
all non-option arguments.  So change the usage message for debugfs's
ea_set command, and then fix the d_xattr_sorting test.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2undo: #include <libgen.h> since we use basename()
Theodore Ts'o [Mon, 6 Jun 2016 20:19:11 +0000 (16:19 -0400)]
e2undo: #include <libgen.h> since we use basename()

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agotests: use tar xf -, some tars default to tape dev.
Matthias Andree [Mon, 6 Jun 2016 04:54:11 +0000 (00:54 -0400)]
tests: use tar xf -, some tars default to tape dev.

FreeBSD's tar defaults to reading from /dev/sa0 when no -f option is
given, so turn "tar x" into "tar xf -" on j_corrupt_ext_jnl_sb_*.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agomke2fs: warn if user provides a label which is too long
Theodore Ts'o [Mon, 6 Jun 2016 03:18:30 +0000 (23:18 -0400)]
mke2fs: warn if user provides a label which is too long

Addresses-Debian-Bug: #791630

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebugfs: clarify man page for the -b and -s options
Theodore Ts'o [Sat, 4 Jun 2016 03:37:28 +0000 (23:37 -0400)]
debugfs: clarify man page for the -b and -s options

Addresses-Debian-Bug: #766379

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAdd clarifications to the e4defrag and resize2fs man pages
Theodore Ts'o [Sat, 4 Jun 2016 03:28:33 +0000 (23:28 -0400)]
Add clarifications to the e4defrag and resize2fs man pages

Addresses-Debian-Bug: #761144
Addresses-Debian-Bug: #770750

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
by 1 commit.

7 years agoDocument when ext2/3/4 features were added to the kernel
Theodore Ts'o [Sat, 4 Jun 2016 03:09:58 +0000 (23:09 -0400)]
Document when ext2/3/4 features were added to the kernel

Document when ext2/3/4 features were added to the kernel in the
ext4(5) man page.

Addresses-Debian-Bug: #428361

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoClarify and clean up the ext4(5) man page
Pete Haddow [Fri, 3 Jun 2016 09:45:41 +0000 (10:45 +0100)]
Clarify and clean up the ext4(5) man page

Signed-off-by: Pete Haddow <pete@leptonyx.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebugfs.8, e2fsck.8: clarify man pages these programs can operate on files
Theodore Ts'o [Fri, 3 Jun 2016 03:26:57 +0000 (23:26 -0400)]
debugfs.8, e2fsck.8: clarify man pages these programs can operate on files

Addresses-Debian-Bug: #766127

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebugfs: fix rdump so it can start from the root directory
Theodore Ts'o [Fri, 3 Jun 2016 03:05:11 +0000 (23:05 -0400)]
debugfs: fix rdump so it can start from the root directory

Previously "rdump / /tmp/out" would fail with the error message:

rdump: File exists while making directory /tmp/out/

Also fix the fast symlink detection logic so that it works when a
symlink has one or more extended attributes.

Addresses-Debian-Bug: #766125

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agomisc: fix gcc -Wall complaints
Theodore Ts'o [Fri, 3 Jun 2016 02:40:41 +0000 (22:40 -0400)]
misc: fix gcc -Wall complaints

Especially when compiling for a 32-bit architecture.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebian: disable tdb when building the binaries for the udebs
Theodore Ts'o [Tue, 31 May 2016 06:05:50 +0000 (02:05 -0400)]
debian: disable tdb when building the binaries for the udebs

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebian: change e2fsprogs to Suggests, instead of Recommends fuse2fs
Theodore Ts'o [Tue, 31 May 2016 05:49:46 +0000 (01:49 -0400)]
debian: change e2fsprogs to Suggests, instead of Recommends fuse2fs

Recommends is too strong of a dependency to use here.

Addresses-Debian-Bug: #825868

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebian: don't build the fuse2fs package for the Hurd OS
Theodore Ts'o [Tue, 31 May 2016 05:48:18 +0000 (01:48 -0400)]
debian: don't build the fuse2fs package for the Hurd OS

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebian: adjust how we build hardened binaries to avoid blhc complaints
Theodore Ts'o [Tue, 31 May 2016 05:27:24 +0000 (01:27 -0400)]
debian: adjust how we build hardened binaries to avoid blhc complaints

Avoid false positives for blhc.  Also, build the object files for the
static library using -fPIE so they can be linked with a shared
executable linked with -pie.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolib: build elf shared libraries using -fPIC -shared
Theodore Ts'o [Tue, 31 May 2016 05:25:58 +0000 (01:25 -0400)]
lib: build elf shared libraries using -fPIC -shared

Make sure we use "-fPIC -shared" consistently on linker and compiler
command lines when building or linking the shared objects for the ELF
shared library.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoFix Android build warnings
Theodore Ts'o [Mon, 30 May 2016 03:35:13 +0000 (23:35 -0400)]
Fix Android build warnings

Also fix some additional gcc -Wall build warnings in a traditional
Linux environment.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAdd configure --disable-tdb which disables e2fsck's scratch_files feature
Theodore Ts'o [Mon, 30 May 2016 00:48:54 +0000 (20:48 -0400)]
Add configure --disable-tdb which disables e2fsck's scratch_files feature

The scratch_files feature is not really needed except on 32-bit
platforms, since tdb's performance is pretty awful given how we are
using it.  Maybe SQLite would be faster, but for 64-bit platforms,
enabling swap works fairly well, especially using the rbtree for the
bitmap abstraction.

We leave tdb for Android since it's unlikely that someone will be
trying to connect petabyte+ sized file systems to a mobile handset.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolibsupport: fix gcc -Wall nits
Theodore Ts'o [Sun, 29 May 2016 21:36:43 +0000 (17:36 -0400)]
libsupport: fix gcc -Wall nits

Also add better error checking to mke2fs and e2fsck's calls to quota
functions in libsupport.a.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoFix "make gcc-wall" for library code
Theodore Ts'o [Sun, 29 May 2016 21:07:17 +0000 (17:07 -0400)]
Fix "make gcc-wall" for library code

Commit fd1677e80: "Add --enable-hardening which builds e2fsprogs with
security hardening" broken the gcc warnings mode by changing how
CFLAGS were used to build static and shared library objects.

Also shut up GCC's whining about casting the return value from
dlsym(2) to function pointers --- since due to conflicing standards,
there is no way to use dlsym() without causing gcc to whine one way or
another.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck,resize2fs: fix gcc -Wall nits
Theodore Ts'o [Sun, 29 May 2016 17:36:20 +0000 (13:36 -0400)]
e2fsck,resize2fs: fix gcc -Wall nits

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAndroid.mk: add parse_qtype.c the list of source files
Theodore Ts'o [Sun, 29 May 2016 17:33:58 +0000 (13:33 -0400)]
Android.mk: add parse_qtype.c the list of source files

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agotests: fix f_pre_1970_date_encoding on systems with a 32-bit time_t
Theodore Ts'o [Sun, 29 May 2016 05:07:40 +0000 (01:07 -0400)]
tests: fix f_pre_1970_date_encoding on systems with a 32-bit time_t

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: always fix invalid extra field in timestamps if time_t is 32-bits
Theodore Ts'o [Sun, 29 May 2016 05:05:06 +0000 (01:05 -0400)]
e2fsck: always fix invalid extra field in timestamps if time_t is 32-bits

Systems with 32-bit time_t's can be used past 2038, so we should
always modify dates with extra_time=3.  (On systems with 64-bit
time_t's we will fix these dates before the year 2242.)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolibe2p: apply LDFLAGS when building tests
Filipe Brandenburger [Fri, 27 May 2016 16:58:51 +0000 (12:58 -0400)]
libe2p: apply LDFLAGS when building tests

This was previously addressed by Michael Forney on commit 53904ae543591a
but it seems the test cases from lib/e2p (tst_ostype and tst_feature)
were missed.

Fix them by adding the same $(ALL_LDFLAGS) to those two targets.

Tested by building it on a system that depends on LDFLAGS to produce
working binaries and confirming that `make check` succeeds.

Reported-by: Eric Christopher <echristo@google.com>
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebian: update changelog with changes made to date
Theodore Ts'o [Wed, 25 May 2016 04:30:42 +0000 (00:30 -0400)]
debian: update changelog with changes made to date

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebugfs: fix "set_bg <bg num> checksum calc" on 64-bit file systems
Theodore Ts'o [Wed, 25 May 2016 04:24:25 +0000 (00:24 -0400)]
debugfs: fix "set_bg <bg num> checksum calc" on 64-bit file systems

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: improve error messages when the journal sb is corrupt
Theodore Ts'o [Wed, 25 May 2016 03:11:32 +0000 (23:11 -0400)]
e2fsck: improve error messages when the journal sb is corrupt

If the journal superblock is corrupt and the user declines to fix it
(or runs e2fsck -n), make sure the error messages are clear and
explain that e2fsck cannot (safely) proceed.

Addresses-Debian-Bug: #768162

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebian: use e2fsck.static from BUILD-STD
Theodore Ts'o [Wed, 25 May 2016 02:21:49 +0000 (22:21 -0400)]
debian: use e2fsck.static from BUILD-STD

Now that we are no longer trying to use dietlibc, there's no point
creating a separate build tree for e2fsck.static.  So just use
e2fsck.static from the standard build tree.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebian: simplify rules file
Theodore Ts'o [Tue, 24 May 2016 20:48:25 +0000 (16:48 -0400)]
debian: simplify rules file

Modern versions of debhelper understand how to build udeb, so we can
remove a lot of special case rules in the debain/rules file.  Also use
dh_lintian instead of open-coding the rules to copy in the Lintian
overrides files.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebian: package fuse2fs in its own separate package
Theodore Ts'o [Tue, 24 May 2016 19:38:01 +0000 (15:38 -0400)]
debian: package fuse2fs in its own separate package

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebian: update changelog with changes made to date
Theodore Ts'o [Mon, 23 May 2016 00:57:32 +0000 (20:57 -0400)]
debian: update changelog with changes made to date

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebian: loosen up dependency on debhelper
Theodore Ts'o [Sun, 22 May 2016 07:20:25 +0000 (03:20 -0400)]
debian: loosen up dependency on debhelper

In order to allow this package to be built on jessie, just depend on
debhelper >= 9.0.  We will test to see if dh_update_autotools_config
exists and only use it if it is present.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebian: build with hardening set to "all"
Theodore Ts'o [Sun, 22 May 2016 07:19:30 +0000 (03:19 -0400)]
debian: build with hardening set to "all"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAdd --enable-hardening which builds e2fsprogs with security hardening
Theodore Ts'o [Sun, 22 May 2016 03:51:19 +0000 (23:51 -0400)]
Add --enable-hardening which builds e2fsprogs with security hardening

Enable the following security features: stack protection, fortify,
read-only relocation tables, immediate dynamic symbol binding, and
text segment ASLR by enabling position independent executable
(PIE).

Special handling is provided for shared library and statically linked
executables.  For all the gory details please see:

   https://lists.debian.org/debian-devel/2016/05/msg00302.html

Distributions who want to do their own special thing can set CFLAGS,
CFLAGS_SHLIB, CLFAGS_STLIB, LDFLAGS, LDFLAGS_SHLIB and LDFLAGS_STATIC
as appropriate.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: fix project quota support
Theodore Ts'o [Sun, 22 May 2016 02:10:39 +0000 (22:10 -0400)]
e2fsck: fix project quota support

Use a large_inode so that when e2fsck is fixing a file system with
project quota enabled, the correct project id's quota is adjusted when
a corrupted inode is deleted.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agomke2fs: fix project quota creation
Theodore Ts'o [Sun, 22 May 2016 00:31:59 +0000 (20:31 -0400)]
mke2fs: fix project quota creation

Creating a file system with project quotas can fail if mke2fs is built
using hardening options.  This is because quota_compute_usage() used
ext2fs_get_next_inode() instead of ext2fs_get_inode_full(), and a
small inode was passed into quota_data_add, when a large inode needs
to be used.  As a result get_dq() would end up dereferencing undefined
space in the stack.  Without the hardening options, this would be
zero, so "mke2fs -t ext4 -O project.quota -I 256 test.img" would work
essentially by accident.

Fix this by using ext2fs_get_inode_full() so that a large inode is
available to quota_data_inodes().

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: Use Package-Type instead of XC-Package-Type
Theodore Ts'o [Sat, 21 May 2016 18:13:34 +0000 (14:13 -0400)]
debian: Use Package-Type instead of XC-Package-Type

XC-Package-Type was deprecated and replaced with Package-Type starting
in dpkg-dev 1.15.7.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoe2fsck: use com_err error codes instead of EBADMSG and EUCLEAN
Theodore Ts'o [Sat, 21 May 2016 17:43:09 +0000 (13:43 -0400)]
e2fsck: use com_err error codes instead of EBADMSG and EUCLEAN

Some operating systems may not define EBADMSG and EUCLEAN, so for
better portability use our own private error code numbers.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoClean up spelling errors and other nits in man pages
Theodore Ts'o [Sat, 21 May 2016 17:40:49 +0000 (13:40 -0400)]
Clean up spelling errors and other nits in man pages

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: fix spelling mistakes in copyright files
Theodore Ts'o [Sat, 21 May 2016 16:43:37 +0000 (12:43 -0400)]
debian: fix spelling mistakes in copyright files

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: fix packaging nits
Theodore Ts'o [Sat, 21 May 2016 14:54:36 +0000 (10:54 -0400)]
debian: fix packaging nits

Fix bad date in debian/changelog, as well as a dropped entry for
1.43~WIP.2016.03.15-2.

Tighted dependency version for debhelper to reflect use of
dh_update_autotools_config.

Removed unused source Lintian overrides.

Thanks to Mattia Rizzolo for pointing these out.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: remove unused and deprecated substitution variables
Theodore Ts'o [Sat, 21 May 2016 04:15:46 +0000 (00:15 -0400)]
debian: remove unused and deprecated substitution variables

Replace "Source-Version" with "binary:Version" in
e2fsprogs.shlibs.local, and e2fsck-static doesn't have any shared
libraries dependency so remove the ${shlibs:Depends} from the Depends.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: backup/restore the po files which get modified during the build
Theodore Ts'o [Sat, 21 May 2016 03:43:29 +0000 (23:43 -0400)]
debian: backup/restore the po files which get modified during the build

Before running "make update-gmo", backup the po/*.gmo and po/*.po
files so they can be restored when "make -f debian/rules clean" is
run.  This allows the Debian source tree to built and rebuilt.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agotests: fix filter.sed to filter out version numbers of the form 1.43
Theodore Ts'o [Sat, 21 May 2016 01:02:09 +0000 (21:02 -0400)]
tests: fix filter.sed to filter out version numbers of the form 1.43

The regular expression worked for version numbers such as 1.42.12, but
not if there isn't a third component in the version number.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: update changelog for 1.43-2
Theodore Ts'o [Fri, 20 May 2016 18:19:15 +0000 (14:19 -0400)]
debian: update changelog for 1.43-2

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: create dbgsym packages if debhelper supports them
Theodore Ts'o [Fri, 20 May 2016 17:37:58 +0000 (13:37 -0400)]
debian: create dbgsym packages if debhelper supports them

Starting with Debian Stretch, we now have support for dbgsym packages
which are uploaded to a separate package archive.  Since some people
might want to try to backport e2fsprogs 1.43 for Jessie set things up
so that the package can be built on older Debiain systems (where the
legacy dbg packages will be created) as well as newer (as of this
writing, Debian Sid or Stretch).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: only try to execute update-initramfs if it exists
Theodore Ts'o [Fri, 20 May 2016 17:37:20 +0000 (13:37 -0400)]
debian: only try to execute update-initramfs if it exists

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: use dh_update_autotools_config to update config.{guess,sub}
Theodore Ts'o [Thu, 19 May 2016 23:13:16 +0000 (19:13 -0400)]
debian: use dh_update_autotools_config to update config.{guess,sub}

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: update watch file to check the GPG signed tar files
Theodore Ts'o [Thu, 19 May 2016 22:24:29 +0000 (18:24 -0400)]
debian: update watch file to check the GPG signed tar files

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoUpdate release notes for a 1.43 (17-Mar-2016) v1.43
Theodore Ts'o [Tue, 17 May 2016 05:14:25 +0000 (01:14 -0400)]
Update release notes for a 1.43 (17-Mar-2016)

8 years agomke2fs.conf: don't enable metadata_csum by default
Theodore Ts'o [Tue, 17 May 2016 05:30:42 +0000 (01:30 -0400)]
mke2fs.conf: don't enable metadata_csum by default

For the 1.43 release, we will not be enabling the metadata_csum
feature by default.  We will leave that up to distribution vendors to
decide whether they want to be aggressive about enabling this feature
by default.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agotests: rename t_mke2fs_errors and t_mke2fs_offset
Theodore Ts'o [Tue, 17 May 2016 04:58:34 +0000 (00:58 -0400)]
tests: rename t_mke2fs_errors and t_mke2fs_offset

The 't' prefix is for tune2fs tests.  The 'm' prefix is for mke2fs
tests.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agomisc: fix various Coverity warnings
Theodore Ts'o [Tue, 17 May 2016 04:53:47 +0000 (00:53 -0400)]
misc: fix various Coverity warnings

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoe2undo: support the undo header's fs_offset feature
Marcus Huewe [Thu, 12 May 2016 19:36:39 +0000 (15:36 -0400)]
e2undo: support the undo header's fs_offset feature

If the fs_offset feature is present (and no "-o offset"
option is specified), e2undo performs the undo operation at
the stored offset.

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agolibext2fs: add fs_offset entry to the undo header
Marcus Huewe [Thu, 12 May 2016 19:36:12 +0000 (15:36 -0400)]
libext2fs: add fs_offset entry to the undo header

The fs_offset entry stores the filesystem offset. This allows for an
easy undo, because one does not have to remember/specify the
filesystem offset manually.
The fs_offset entry is implemented as a compatible feature.

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoe2undo: add "-o offset" option to specify the filesystem offset
Marcus Huewe [Thu, 12 May 2016 19:36:00 +0000 (15:36 -0400)]
e2undo: add "-o offset" option to specify the filesystem offset

This is useful if the filesystem is located at an arbitrary
offset instead of the beginning of a device or file.

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agolibext2fs: fix key extension in undo_write_tdb
Marcus Huewe [Thu, 12 May 2016 19:35:44 +0000 (15:35 -0400)]
libext2fs: fix key extension in undo_write_tdb

Support key extension if the tdb_data_size is an arbitrary integer
multiple of the channel's block size. Before, key extension was only
possible if the tdb_data_size and the channel's block size were
equal.
Note: a key, whose data is the result of a short read, will be
extended if the tdb_data_size and the channel's block size are equal
(that's what the old code did) (if tdb_data_size is an arbitrary
integer multiple (> 1) of the channel's block size, the key might
be extended as well (depending on the keysize)).

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agolibext2fs: fix offset code in undo_write_tdb
Marcus Huewe [Thu, 12 May 2016 19:35:04 +0000 (15:35 -0400)]
libext2fs: fix offset code in undo_write_tdb

The old code has some issues, for example, when backing up fs block 0
(can be reproduced via "mke2fs -z undo -b 1024 -E offset=1024 out 1024"):
* backing_blk_num is set to ULLONG_MAX instead of 0
* data is read from the beginning of the file instead of offset 1024
* data_ptr is set to read_ptr - 1024 ("invalid" address)

Hence, the wrong fs block is associated with the wrong data.
For details, see also commit 76da764639cbfcc998f13c263a11a4601bcb9961.

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agotests: testcases for the offset handling in e2undo and undo_io.c
Marcus Huewe [Thu, 12 May 2016 19:26:09 +0000 (15:26 -0400)]
tests: testcases for the offset handling in e2undo and undo_io.c

The testcase "u_offset" tests/defines e2undo's new UI and offset
handling code. The testcase "u_mke2fs_opt_offset" documents some
issues with undo_io.c's old offset handling code (e.g., backup of
fs block 0, key extension (tdb_data_size != block_size) etc.).

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agomke2fs: fix filesystem size calculation, if an offset is specified
Marcus Huewe [Thu, 12 May 2016 19:25:14 +0000 (15:25 -0400)]
mke2fs: fix filesystem size calculation, if an offset is specified

If a filesystem size is explicitly specified, it should be used without
subtracting the offset.

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agotests: test "mke2fs -E offset=N" filesystem size calculation
Marcus Huewe [Thu, 12 May 2016 19:08:46 +0000 (15:08 -0400)]
tests: test "mke2fs -E offset=N" filesystem size calculation

If "mke2fs -E offset=N ..." is called without a specified filesystem size,
the offset should be subtracted from the default filesystem size (see
commit 87d9b2fb). If "mke2fs -E offset=N ..." is called with an
explicitly specified filesystem size, the specified filesystem size
should be used.

Also, call dd with the "iflag=fullblock" option, if it is going to read
from a pipe.

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: make e2fsprogs.postinst abort on error v1.43-WIP-2016-05-12
Theodore Ts'o [Thu, 12 May 2016 05:42:58 +0000 (01:42 -0400)]
debian: make e2fsprogs.postinst abort on error

Also fix typo in the postinst script

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoUpdate release notes for a 1.43-WIP release (12-May-2016)
Theodore Ts'o [Thu, 12 May 2016 05:02:53 +0000 (01:02 -0400)]
Update release notes for a 1.43-WIP release (12-May-2016)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoUpdate e2fsprogs translation template file
Theodore Ts'o [Thu, 12 May 2016 05:01:46 +0000 (01:01 -0400)]
Update e2fsprogs translation template file

8 years agofuse2fs.1: fix man page section of fuse2fs
Theodore Ts'o [Thu, 12 May 2016 04:02:07 +0000 (00:02 -0400)]
fuse2fs.1: fix man page section of fuse2fs

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: stop using dietlibc to build the static binaries
Theodore Ts'o [Thu, 12 May 2016 04:00:38 +0000 (00:00 -0400)]
debian: stop using dietlibc to build the static binaries

It's better to keep the e2fsprogs binaries consistently all using
glibc.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agolibext2fs: sanity check group argument to ext2fs_clear_{block,inode}_uninit()
Theodore Ts'o [Thu, 12 May 2016 03:23:06 +0000 (23:23 -0400)]
libext2fs: sanity check group argument to ext2fs_clear_{block,inode}_uninit()

Avoid a potential out-of-bounds memory access if the group passed to
ext2fs_clear_block_uninit() or ext2fs_clear_inode_uninit() is greater
than the number of groups in the file system.  This prevents a failure
in resize2fs when to allocate a block when growing the file system
significantly.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agomisc: avoid PATH_MAX dependency in create_inode.c
Theodore Ts'o [Wed, 11 May 2016 04:08:58 +0000 (00:08 -0400)]
misc: avoid PATH_MAX dependency in create_inode.c

Addresses-Debian-Bug: #822576

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agolibext2s: only define FS_IOC_FIEMAP on Linux systems
Theodore Ts'o [Wed, 11 May 2016 03:44:21 +0000 (23:44 -0400)]
libext2s: only define FS_IOC_FIEMAP on Linux systems

Hurd and *BSD is not going to have FS_IOC_FIEMAP, at least not at
Linux's codepoint.

Addresses-Debian-Bug: #822576

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: disable fus2fs for Hurd
Theodore Ts'o [Wed, 11 May 2016 03:41:38 +0000 (23:41 -0400)]
debian: disable fus2fs for Hurd

Hurd's libfuse is not compatible with the Linux version of libfuse.

Addresses-Debian-Bug: #822576

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agodebian: update initramfs in e2fsprogs's postinst script
Theodore Ts'o [Wed, 11 May 2016 03:27:04 +0000 (23:27 -0400)]
debian: update initramfs in e2fsprogs's postinst script

Addresses-Debian-Bug: #804237

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoMore man page and usage message fixups
Theodore Ts'o [Wed, 11 May 2016 03:23:14 +0000 (23:23 -0400)]
More man page and usage message fixups

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoresize2fs, libext2fs: fix bugs in sparse_super2 support
Theodore Ts'o [Wed, 11 May 2016 01:06:15 +0000 (21:06 -0400)]
resize2fs, libext2fs: fix bugs in sparse_super2 support

Fix resize2fs so that the location of the backup superblocks when the
sparse_super2 feature is enabled is properly set when growing the file
system from a single block group to larger file system sizes.

Also fix a bug where the block group summary statistics in some cases
when exapnding a sparse_super2 file system.

Finally, accurately calculate the file system metadata overhead of the
last block group in sparse_super2 file systems.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agomke2fs: support multiple -O options
Theodore Ts'o [Tue, 10 May 2016 21:41:08 +0000 (17:41 -0400)]
mke2fs: support multiple -O options

Some users will get confused and try to specify multiple -O options.
So teach mke2fs to treat "-O feature1 -O feature2" as
"-O feature1,feature2".

https://bugzilla.kernel.org/show_bug.cgi?id=117421

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoutil: remove lib/support from the e2fsprogs-libs tar distribution
Theodore Ts'o [Tue, 10 May 2016 20:18:44 +0000 (16:18 -0400)]
util: remove lib/support from the e2fsprogs-libs tar distribution

The lib/support library is only used for internal e2fsprogs programs,
and it won't compile correctly due to the fact that lib/ext2fs isn't
included in the e2fsprogs-libs distribution anyway.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoFix various man pages and usage message
Theodore Ts'o [Mon, 9 May 2016 02:12:41 +0000 (22:12 -0400)]
Fix various man pages and usage message

Thanks to pete@lyptonyx for doing a close pass editing of e2fsprogs's
man pages.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agolibe2p: change the long flag name for -P to be Project_Hierarchy
Theodore Ts'o [Mon, 9 May 2016 02:11:36 +0000 (22:11 -0400)]
libe2p: change the long flag name for -P to be Project_Hierarchy

This more clearly describes what the flag means.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>