Since e2image is used to capture broken fs images for debugging,
ignore checksum errors when creating the image.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Update the tests to match with the new behavior and error messages
Also fix test_one so that it doesn't print the failed test output in
the case where the script does not exist.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
If e2fsck_run_ext3_journal() returns an error indicating that a CRC
error was detected, we shouldn't abort, but instead proceed so the
file system can be fixed.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
If the UUID field is NULL, e2fsck will try to generate and set a new
UUID. This will cause massive problems if the metadata_csum feature
is set, so avoid doing so in that case.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Sync up with kernel commit 6a797d27: "ext4: call out CRC and
corruption errors with specific error codes".
This allows us to distinguish between CRC errors and I/O errors.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Commit c8ee0d60 fixed most of these, but missed this one.
# e2image -r -p <device> - > imagefile
leads to a corrupted image due to the "Scanning inodes..."
printf going to stdout.
Reported-by: Alex Markley <alex@malexmedia.net>
Addresses-Red-Hat-Bugzilla: #1327329
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Configure the io channel with the specified offset before
calling mke2fs_discard_device(). Otherwise the data before offset
is discarded.
Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Added offset support to the following functions:
- unix_cache_readahead
- unix_discard
- unix_zeroout
Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Test that mke2fs does not modify any data before the offset and
after the end of the filesystem.
Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
When calculating time diffs, use difftime() instead of risking
integer overflow. Also build a "blkid" binary.
Addresses-Google-Bug: #11175082
Change-Id: I23521f45204574bb32f152926401c2cbad93175b
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
After
http://git.kernel.org/cgit/fs/ext2/e2fsprogs.git/commit/lib/ext2fs/llseek.c?id=274d46e1d35af423d0292d63c4d0ad7a03be82ba
with
__linux__
defined(HAVE_LSEEK64) && defined(HAVE_LSEEK64_PROTOTYPE)
SIZEOF_OFF_T >= SIZEOF_LONG_LONG
it leads to ext2fs_llseek() doing a "return lseek(fd, offset, origin);"
Which fails for offsets > 32bit.
Also, with
__linux__
!(defined(HAVE_LSEEK64) && defined(HAVE_LSEEK64_PROTOTYPE))
defined(HAVE_LLSEEK)
SIZEOF_OFF_T == SIZEOF_LONG_LONG
my_llseek is not defined at all. And there is no need to define
llseek as lseek, as llseek is never used.
Luckily ext2fs_llseek() then does "return lseek(...);"
It would seem that my_llseek should be used in both places.
Addresses-Google-Bug: #13340735
Change-Id: Ie7330300c9c1ca103eaaef97536dcf10adbbba02
Signed-off-by: JP Abgrall <jpa@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
In commit 0355d6d047 we used a Makefile shell assignment syntax
which is compatible with pmake and gmake 4.x, but which breaks on
gmake 3.x. So only use the pmake-compatible construction if we are
not using GNU make.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
FreeBSD doesn't have libintl support built into the libc, and
libsupport requires libintl support. So we need to make sure it is
available when we link against the libsupport library.
Also, work around *BSD's interesting interpretation of how
_XOPEN_SOURCE is supposed to work.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The major() cpp macro is defined as requiring sys/types.h to be
included with _BSD_SOURCE defined. However, in older glibc's this
hasn't been strictly required and the stdlib.h header file included
sys/types.h implicitly. Fix this so that more aggressive
distributions run into build errors.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
in with andchanges. Lines starting
Glibc has depcreated _SVID_SOURCE and _BSD_SOURCE in favor of
_DEFAULT_SOURCE. So define _DEFAULT_SOURCE to shut up glibc 2.20
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Most libraries use the "-host" suffix when building for the host. This
patch renames all the libraries to use -host instead of _host.
Addresses-Google-Bug: #24619596
TEST=make dist
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
We are using a new convention for the 1.43-WIP releases which should
be less confusion by replacing the hyphens by periods (e.g.,
1.43~WIP.2016.03.06 instead of 1.43~WIP-2016-03-06). This avoids
confusion regarding the debian release number (which uses the last
hyphen in the version string to separate the upstream version from the
release number).
Also fix a typo in the version number used in the debian changelog and
e2fslibs.symbols file.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
These package version metadata files will be used for automated
notification of external vulnerability reports in Android.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
When adding 'libext2fs' as a library dependency from any other binary,
the binary needs to find the library headers. Users of this library
should not hard-code the include path themselves. This patch exports the
library headers on all three version of the libext2fs library and
removes the redundant include path from executables in e2fsprogs.
Addresses-Google-Bug: #23084776
TEST=mma
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Older kernels on 64-bit machines would incorrectly encode pre-1970
ext4 dates as post-2311 dates. Detect and correct this (assuming the
current date is before 2242).
Include tests for this, as well as changes to debugfs to correctly
set crtimes.
Signed-off-by: David Turner <novalis@novalis.org>
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>