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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>