For platforms whose libc don't supply strdup(), the replacement strdup
function in lib/ext2fs/tdb.c needs to always initialize the length
variable.
Reported-by: Vladyslav Tsilytskyi <ykp@protonmail.ch>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
There's no point creating two separate tarfiles. It's not clear
anyone was actually using the subset tarball --- and if they are, they
can replace it by the full source distribution and using the
--enable-subset option.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
It adds extra complexity for not much gain, and stands in the way of
generating the release tarfile via git archive.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
They are removed when we generate the tarball, and they serve no
useful purpose, so let's remove them. This will be help us to create
the tarball using git archive more easily.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Now that we use a symlink for the top-level RELEASE-NOTES file, the
previous strategy of using a symlink to force the prefix in the tar
file and then using tar -h won't work. So change how we generate the
tar file to take advantage of GNU tar's --transform option.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Not all compilers (or versions of compilers) use the same LTO options
or behave the same way with LTO. In particular, using clang and the
current LTO options cause the build to fail. We should probably fix
up the configure script to handle Clang and LTO, but for now, we won't
enable LTO unless the user explicitly passes --enable-lto to the
configure script.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This should have been part of commit 2fcbcb1b9e: "Fix function
declarations for ss commands to fix LTO warnings".
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Test that mke2fs does not allow to create file system with both
resize_inode and meta_bg features enabled.
This was fixes with commit 42e77d5d ("libext2fs: don't create
filesystems with meta_bg and resize_inode").
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Test if the e2fsck can fix file system with resize_inode and meta_bg
features enabled simultaneously.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The dh_installsystemd command is only available with Debhelper v11 and
higher. So explicitly declare that we need debhelper 11, and create a
fallback for debhelper compat level 9 (so we can easily backport to
Debian Stretch and Ubuntu 16.04).
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Previous e2fsprogs versions allowed to create a file system with both
resize_inode and meta_bg enabled. This was fixed by upstream commit
42e77d5d ("libext2fs: don't create filesystems with meta_bg and resize_inode")
However e2fsck still does not recognize the conflict and will attempt to
clear and recreate resize_inode if it's corrupted due to this incompatible
feature combination, though it will create it in the same wrong layout.
Fix it by teaching e2fsck to recognize resize_inode and meta_bg
conflict and fixing it by disabling and clearing resize inode.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
CFLAGS is supposed to be something that can be overridden by the
developer. So extra stuff like $(SANITIZER_CFLAGS) should not be
defined there, but rather in ALL_CFLAGS.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The jfs_user.h, which is used by the journal functions didn't include
config.h before including e2fsck.h. This caused the e2fsck structure
to be different compared how it's compiled for the other e2fsck source
files.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
We play games with pointers to incomplete types to handle subclassing
using the C language, use the first four bytes (the magic number)
field to disambiguate between different subclasses. The way we were
doing it before, we relied defining the structure differently
depending on the C file implementing different backend subclasses.
This triggers LTO warnings, since it appears (and in fact, we are)
using functions defined with different types than how they were
defined by calling C file.
Fix the LTO warnings by using an explicit base bitmap structure, and
then casting it to the 32-bit or 64-bit variant as needed.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Enable the gcc/clang thread data corruption sanitizer if the builder
requests it and it's available.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Enable AddressSanitizer to look for memory usage errors if the builder
asks for it and it's available.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Enable the undefined behavior sanitizer (ubsan) if the builder requests
it and it's available.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Enable link time optimization (LTO) if the builder requests it. The
extra link optimization results in smaller binaries.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Add the ability to run the e2scrub utilities as a periodically scheduled
system service.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Create an e2scrub_all command to find all ext* filesystems
and run an online scrub against them all.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Implement online fsck for ext* filesystems which live on LVM-managed
logical volumes. The basic strategy mirrors that of e2croncheck --
create a snapshot, fsck the snapshot, report whatever errors appear,
remove snapshot. Unlike e2croncheck, this utility accepts any LVM
device path, knows about snapshots running out of space, and can call
fstrim having validated that the fs metadata is ok.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Allow the administrator to mark the filesystem's error bit to force a
fsck at the next mount.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs now links to a new libext2_support library, which only includes
cstring.c (Android separates other pieces of libsupport into separate
libraries).
e2fsck now builds with -Wno-unused-variable to work around an unused
variable introduced by cabde4999d.
libext_e2p builds the new ljs.c file, and links to ws2_32 on Windows for
ntohl().
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Change-Id: I42edce0478f1529f44acdbef1495ec5270e3a61e
From AOSP commit: af14814afe0cb3389ecc4b9e9422bd7e8962e0ed
This is needed after 3fb715b554 which
conditionally included sysmacros.h.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Change-Id: I52e3da4d9ea0f5efbf685a9c4a266f33357f8d8c
From AOSP commit: a5deff7b7ee15a5ba5d65516326ce4c42daa1027
bionic does not define _LINUX_TYPES_H but does define __bitwise, so we
conditionally define it here.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Change-Id: I500ccd469ea7de2e53ab8bd75720a412c86cf18b
From AOSP commit: 77f2eea2717e18e80a31d80c7721b9e0ed8e0cba
Due to hard links inodes can have multiple names (except for folders),
ncheck should find all of the names (equal to the number of links to the
inodes, directories excepted), not names to the count of the provided
inodes.
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Using symlinks to save space on duplicate copies of the
/usr/share/doc/*/changelog.Debian.gz is a bit of a mess, since when
the foo-dev package is removed, the files in /usr/share/doc/libfoo/*
get removed, which means the copyright file gets removed.
So stop doing this altogether, and set up maintainer scripts to clean
up the mess so that the symlinks are removed when the packages get
upgraded.
Addresses-Debian-Bug: #905195
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Remove the rant about the "real" kilobytes from the man page and just
make it more clear that the suffixed units are representing power-of-two
units as we do in mke2fs man page. Also add terabytes to the list.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
If a sparse file fails to load, an inconsistent channel pointer will be
returned, causing e2fsdroid to crash on exit.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Bug: 64109868
Change-Id: If1606c7c49d5569323db5b5fce4826f24ba76383
From AOSP commit: 0f31d29a968eed6dc3c96eb47fd34e8608a2580c
-Wimplicit-fallthrough option was added in gcc7 and
-Wpedantic was added in gcc4.8, while #pragma GCC diagnostic
support was not available until gcc4.6
We got following warnings:
../lib/ext2fs/fiemap.h:35: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../lib/ext2fs/fiemap.h:36: warning: unknown option after ‘#pragma GCC diagnostic’ kind
../lib/ext2fs/fiemap.h:38: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
and error:
filefrag.c: In function ‘main’:
filefrag.c:577: error: #pragma GCC diagnostic not allowed inside functions
filefrag.c:578: error: #pragma GCC diagnostic not allowed inside functions
filefrag.c:595: error: #pragma GCC diagnostic not allowed inside functions
when compiling latest e2fsprogs with a gcc older than 4.6
e.g. on CentOS 6.9
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>