Commit Graph

5552 Commits (1944d8c53d613b5185b5fe6734007f41324e4421)

Author SHA1 Message Date
Theodore Ts'o 81f965a04d 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>
2016-06-07 11:47:40 -04:00
Theodore Ts'o 43b7b054cd 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>
2016-06-07 11:44:54 -04:00
Matthias Andree afaf6db69f 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>
2016-06-07 10:50:12 -04:00
Theodore Ts'o ded919125a 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>
2016-06-07 10:47:20 -04:00
Theodore Ts'o 3166e2e540 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>
2016-06-07 01:01:45 -04:00
Theodore Ts'o 32179ce25b configure: fix detection of dlopen() for BSD systems
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-07 01:01:37 -04:00
Theodore Ts'o 770d9f5e28 Merge branch 'maint' into next 2016-06-07 01:01:22 -04:00
Theodore Ts'o 127e2291bf 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>
2016-06-06 23:04:43 -04:00
Theodore Ts'o be05f60ecf 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>
2016-06-06 16:49:37 -04:00
Theodore Ts'o 7618802123 e2undo: #include <libgen.h> since we use basename()
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-06 16:19:11 -04:00
Matthias Andree 254c50ff5f 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>
2016-06-06 00:54:11 -04:00
Theodore Ts'o 2832fd8b8f mke2fs: warn if user provides a label which is too long
Addresses-Debian-Bug: #791630

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-05 23:18:30 -04:00
Theodore Ts'o edc7b0988a debugfs: clarify man page for the -b and -s options
Addresses-Debian-Bug: #766379

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-03 23:37:28 -04:00
Theodore Ts'o 97b7a94679 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.
2016-06-03 23:28:33 -04:00
Theodore Ts'o 50a6f4a2cf 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>
2016-06-03 23:09:58 -04:00
Pete Haddow f8a801d05f 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>
2016-06-03 13:44:41 -04:00
Theodore Ts'o a9a81b1f2f 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>
2016-06-02 23:29:12 -04:00
Theodore Ts'o ebb8b1aa04 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>
2016-06-02 23:29:07 -04:00
Theodore Ts'o 377e3a9657 misc: fix gcc -Wall complaints
Especially when compiling for a 32-bit architecture.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-02 22:40:41 -04:00
Theodore Ts'o 3dcb760f2a debian: disable tdb when building the binaries for the udebs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-31 02:08:50 -04:00
Theodore Ts'o 7f62f07577 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>
2016-05-31 02:08:42 -04:00
Theodore Ts'o d3c0595704 debian: don't build the fuse2fs package for the Hurd OS
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-31 02:05:30 -04:00
Theodore Ts'o 04f34e7182 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>
2016-05-31 01:54:16 -04:00
Theodore Ts'o 0eb9fb99da 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>
2016-05-31 01:54:09 -04:00
Theodore Ts'o 12147857a0 Synchronize debian packaging with next
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-29 23:54:12 -04:00
Theodore Ts'o 478360f50b 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>
2016-05-29 23:51:08 -04:00
Theodore Ts'o 749f07121d 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>
2016-05-29 21:52:52 -04:00
Theodore Ts'o a701823a31 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>
2016-05-29 17:36:43 -04:00
Theodore Ts'o c2ff6bac50 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>
2016-05-29 17:07:17 -04:00
Theodore Ts'o 62f9bd0e4f e2fsck,resize2fs: fix gcc -Wall nits
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-29 13:36:20 -04:00
Theodore Ts'o 9a316fe73e Android.mk: add parse_qtype.c the list of source files
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-29 13:33:58 -04:00
Theodore Ts'o 2dd680f3b9 tests: fix f_pre_1970_date_encoding on systems with a 32-bit time_t
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-29 01:07:40 -04:00
Theodore Ts'o c40c832b4c 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>
2016-05-29 01:05:06 -04:00
Filipe Brandenburger c64313084e libe2p: apply LDFLAGS when building tests
This was previously addressed by Michael Forney on commit 53904ae543
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>
2016-05-28 11:20:10 -04:00
Theodore Ts'o 39e05c5672 Merge branch 'next' into debian-packaging 2016-05-25 00:31:53 -04:00
Theodore Ts'o cdf396a039 debugfs: fix "set_bg <bg num> checksum calc" on 64-bit file systems
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit 612f775362)
2016-05-25 00:31:27 -04:00
Theodore Ts'o c59935dc92 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>
(cherry picked from commit d37026ea07)
2016-05-25 00:31:13 -04:00
Theodore Ts'o e2406b990c debian: update changelog with changes made to date
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-25 00:30:42 -04:00
Theodore Ts'o 612f775362 debugfs: fix "set_bg <bg num> checksum calc" on 64-bit file systems
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-25 00:24:25 -04:00
Theodore Ts'o d37026ea07 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>
2016-05-24 23:11:32 -04:00
Theodore Ts'o bf26fae372 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>
2016-05-24 23:11:12 -04:00
Theodore Ts'o e1ada17169 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>
2016-05-24 23:06:54 -04:00
Theodore Ts'o 4fa126b596 Merge branch 'next' into debian-packaging 2016-05-24 15:42:03 -04:00
Theodore Ts'o d133561994 debian: package fuse2fs in its own separate package
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-24 15:38:01 -04:00
Theodore Ts'o 89615d3ad1 Synchronize debian packaging with next
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-24 15:07:13 -04:00
Theodore Ts'o 602432f38c Merge branch 'debian' into debian-packaging 2016-05-24 13:40:10 -04:00
Theodore Ts'o d04897df10 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>
2016-05-24 13:38:05 -04:00
Theodore Ts'o 97c76e0f09 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>
2016-05-24 13:37:53 -04:00
Theodore Ts'o 64f5a8f084 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>
2016-05-24 13:37:45 -04:00
Theodore Ts'o e31b4e03ee 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>
2016-05-24 13:37:29 -04:00