The profile functions started as something specific to e2fsck. It's
now used by mke2fs and e2fsck, so it's better to move it into
libsupport.a.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
We will be using libsupport.a for e2fsprogs's internal support
functions. It will contain the quota support functions, but we will
also be moving code such as profile.c and plausible.c to libsupport.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
For the 1.43 release, quota support will be the default. It's much
simpler if we don't try to make quota support optional. This was done
originally because the quota feature wasn't fully tested. It is now,
so we can remove this as an option.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The presence of --disable-htree is very much a legacy thing. Remove
it since supporting the lack of htree support is pretty silly.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
If we are not buildinig the uuid or blkid library, we shouldn't create
the Makefile and other files generated by configure / config.status.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
There were some generated files that weren't getting removed by the
clean and distclean targets; fix this.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This reverts commit 58b0356a25.
We already have the block_dump (bd) command, but I had completely
forgotten about it. Oops!
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Some newer versions of autoconf kvetch if we are still using
configure.in. As of this writing the only version of autoconf which I
support is autoconf 2.69, and if you try to recreate the configure
script which is shipped with e2fsprogs, and it breaks, you get to keep
both pieces.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The configure script will now determine if the blkid and uuid
libraries are present (requires that pkg-config and their .pc files
are available).
In addition, enable quota support by default.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Fix copy-n-paste errors:
* remove duplicate "lastcheck" and "min_extra_isize"
* fix pointer for "first_error_line" and "last_error_line"
* remove superblock field "inodes_count" from inode fields
* add null-termination for mmp_fields
Add assertions for catching such errors in the future.
Mark true aliases with flag "FLAG_ALIAS" and suppress assert for them.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Prompt for user verification before rewriting the filesystem
superblocks using the "-S" (super-only) option. This should
not normally be used at all, so adding the extra verification
will probably save a few user filesystems in the future. Since
this is something that should only be done in rare cases under
user supervision, wait for user input rather than proceeding
automatically after a timeout.
Update the mke2fs man page to more fully explain the many
dangers of this option.
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Some temporary char buffers allocated on the stack are not properly
aligned when typecast to a structure containing __u32 or __u64 types,
and this can cause alignment warnings on ARM and other alignment
sensitive architectures, and potential slowdowns to do fixups.
Fix the buffer alignment to avoid such issues.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=680090
Reported-by: Gordan Bobic <gordan.bobic@gmail.com>
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Skip tests that create large filesystem on MacOS, since HFS doesn't
have sparse file support and this causes testing to be uninterruptible
for minutes while mke2fs is writing to some large non-zero offset and
filling up the test filesystem. Since most testing is done on Linux
this shouldn't cause a significant gap in testing coverage.
Tests skipped are d_dumpe2fs_group_only, m_bigjournal, m_hugefile,
t_iexpand_full, t_iexpand_mcsum, and t_uninit_bg_rm.
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diet libc doesn't support syscall correctly, but it does have
add_key() and keyctl() in libc (although glibc does not). So change
e4crypt to use add_key() and keyctl() directly if they are available.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
When a file system with journal checksums is mounted, the journal
checksum is only updated when the journal superblock is actually
written to disk. But when a root file system is mounted read-only,
e2fsck will get the in-memory version of the journal superblock, and
the checksum is not necessarily going to be correct. Since we only
allow the root file system to be checked while it is mounted
read-only, and we won't be trying to replay the journal anyway. So we
can skip the checking the journal superblock fields for mounted file
systems.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This resulted in the build failing when building e2fsprogs from
scratch.
Reported-by: "Darrick J. Wong" <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Modern Linux major/minor numbering on block devices no longer conform to
the divisible by 64 rule for minor numbering. On my development system,
the correct number is 16. Consequently, this applies only to every 4th
drive on a modern system, which is inconsistent. That caused the
following bug to be filed against Flocker:
https://clusterhq.atlassian.net/browse/FLOC-2041
We could unconditionally pass -F to override this check whenever it
triggers, but that it would also override the libblkid check that
determines whether there are existing partitions, logical volumes or
filesystems on the disk, which seems unwise.
I propose that this check be removed because passing a whole disk to
mke2fs is a valid use case and given how long this has been broken,
users are already accustomed to the behavior where -F is not necessary
to format a whole disk as ext4.
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Remove all flushes of the undo file except for the one that happens just
prior to the file being closed; it seems that the arbitrary flushes
aren't sufficiently useful.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This is the initial implementation of a FUSE server based on
e2fsprogs. The point of this program is to enable ext4 to run on any
OS that FUSE supports (and doesn't already have a native driver), such
as MacOS X, BSDs, and Windows. The code requires FUSE API v28, which
is available in Linux fuse and osxfuse releases that are available as
of August 2013.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Implement a fallocate function for debugfs, and add some tests to
demonstrate that it works (more or less).
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Use the new fallocate API for creating the journal and the mk_hugefile
feature.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Create a library function to perform fallocation on arbitrary files.
This is a bit more intense than Ted's original mk_hugefiles
implementation since we have to honor any blocks that may already be
allocated to the file.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Add a new get_alloc_blocks hook and a block_alloc_stats_range hook so
that e2fsck can capture allocation requests spanning more than a
block to its block_found_map.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
If MMP support is not configured, then ext2fs_mmp_stop() will always
return the error EXT2_ET_OP_NOT_SUPPORTED. Unfortunately,
ext2fs_close() and tune2fs call ext2fs_mmp_stop() unconditionally. So
if the file system does not have MMP enabled, fix ext2fs_mmp_stop() to
return success even if CONFIG_MMP is not enabled, so that
ext2fs_close() and tune2fs doesn't fail for no good reason.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Having multiple versions of jfs_user.h was confusing the Android
build. Clean up things by removing the lib/ext2fs/jfs_user.h and
misc/jfs_user.h and simplifying how we emulate the kernel
infrastructure needed by journal replay code and removing the
kernel-specific lines from kernel-jbd.h.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Use $DUMPE2FS in resize tests to be sure it's testing
the in-tree dumpe2fs, not the system dumpe2fs (which may
not even be there...)
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/dirinfo.c and misc/e4crypt.c use functions from libext2fs, so
we need to include its header file or clang will complain.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>