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>
Use libfuse's command line parsing, which is much more powerful and
flexible than what we had before, and to allow the user to have more
fine-grained control over FUSE's run-time options.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Remove the stray left parenthesis. Observed while testing bigalloc_1k
filesystems with shared/298 on 32 bit ARM running 4.3 kernels.
Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
If resize2fs_get_alloc_block() allocates from a BLOCK_UNINIT group, we
need to make sure that the UNINIT flag is cleared on both file system
structures which are maintained by resize2fs. This causes the
modified bitmaps to not get written out, which leads to post-resize2fs
e2fsck errors; used blocks in UNINIT groups, not marked in the block
bitmap. This was seen on r_ext4_small_bg.
This patch uses clear_block_uninit() to clear the flag,
and my problem goes away.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Replace the EXT2FS_RB_EMPTY_ROOT(), EXT2FS_RB_EMPTY_NODE(),
EXT2FS_RB_CLEAR_NODE(), IS_BLOCK_BM(), IS_INODE_BM(), and
IS_INODE_TB() macros with static inline functions to avoid
suprious compiler warnings with clang:
pass1.c:618:28: warning: equality comparison with extraneous
parentheses [-Wparentheses-equality]
if ((*((__u32 *)(entry)) == 0UL)) {
~~~~~~~~~~~~~~~~~~~~^~~~~~
pass1.c:618:28: note: remove extraneous parentheses
around the comparison to silence this warning
if ((*((__u32 *)(entry)) == 0UL)) {
^~
pass1.c:618:28: note: use '=' to turn this equality
comparison into an assignment
if ((*((__u32 *)(entry)) == 0UL)) {
^~
=
The static inline functions should compile identically, and allow
some extra compile-time checking for the arguments over macros.
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The interim hack to allow this test to work for the maint branch ends
up leaving the tmpfile around. Clean this up.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>