Commit Graph

5535 Commits (460c0af190ea11c903dd0e0730cfc7c3d279bcc8)

Author SHA1 Message Date
Theodore Ts'o e695c12892 android: be able to build dumpe2fs, lsattr, and e2fsck statically
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-23 12:46:42 -04:00
Theodore Ts'o 956b0f18a5 Merge branch 'maint' into next 2015-07-22 00:18:14 -04:00
Tobias Stoeckmann 9f8d9a2c5f debugfs: handle out of memory condition
If malloc fails, properly handle the error condition.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-22 00:17:08 -04:00
Tobias Stoeckmann 9bcfea2a89 util: avoid off-by-one on long symlinks
readlink does not nul terminate its result, therefore one extra byte
has to be taken into account.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-22 00:17:07 -04:00
Darrick J. Wong 95eca2e922 e2fsck: check htree leaf block checksums
We weren't verifying the checksum of an htree leaf block due to a
coding error that marked all htree blocks as not having checksums.
While we're at it, fix the error message that gets displayed so that
it doesn't print a meaningless block offset.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-22 00:06:43 -04:00
Theodore Ts'o e3dd5c6f1a e2fsck: check for encrypted directory entries with too-short file names
If there are directory entries with file names which are less than 16
bytes, it turns out that passing less than the crypto block size to
the kernel's crypto layer will cause the kernel to crash.

However, since there never should be encrypted directory entries where
the file name is less than 16 bytes (the AES block size), change
e2fsck to offer to address this corruption by deleting the directory
entry.

(We need to checks for this condition into the kernel as well.)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-16 18:02:58 -04:00
Theodore Ts'o 4ecd63d786 e2fsck: check for an encrypted lost+found directory
The /lost+found directory must not be encrypted, since e2fsck won't
have any keys.  If we find an encrypted lost+found directory, we
should delete the directory and recreate it.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-16 15:07:59 -04:00
Theodore Ts'o b97bccecfe android: add add_ext4_encrypt helper program
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-14 23:26:16 -04:00
Theodore Ts'o df0b907ec1 debugfs: cleanup gcc -Wall warnings
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-13 16:00:12 -04:00
Theodore Ts'o 4e222d9b88 misc: cleanup gcc -Wall warnings
Also change ext2fs_symlink() so that the target parameter is a const
char *, thus promising that we will never change the incoming string.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-13 15:36:12 -04:00
Theodore Ts'o f7134a9ece Remove dropped const warning and enable pread/pwrite for Android build
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-13 10:58:33 -04:00
Theodore Ts'o ec794020ac create_inode: remove backup definition of __func__
We are using __func__ without any backup definition in the rest of
e2fsprogs, and this is causing warnings in the Android build, so just
remove it.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-13 10:47:27 -04:00
Theodore Ts'o cf491d3a64 Eliminate unused variable and unused label warnings from Android build
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-13 10:47:16 -04:00
Theodore Ts'o 25f291c9b3 Eliminate unused parameter warnings from Android build
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-13 09:12:23 -04:00
Theodore Ts'o aee40b870c Eliminate unused function warnings from Android build
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 23:09:15 -04:00
Theodore Ts'o f1644c324b Eliminate doubly defined _LARGEFILE_SOURCE warning
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 22:54:37 -04:00
Theodore Ts'o 3dca12fb62 Move dict.c from e2fsck to lib/support
The quota code required that we included dict.o in libsupport.a, so we
might as well just move dict.c and dict.h to lib/support, and then
have e2fsck use the version of dict.c in libsupport.a.  This
simplifies the build system and eliminates having two identical copies
of dict.o floating around in the build tree.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 22:43:31 -04:00
Theodore Ts'o 99ceb8ec1a Move the check_plausibility() function from misc to lib/support
The check_plausibility() function is now used all over the place, so
we should move the plausible.c file to lib/support and remove the
special case handling for that file that had been in the build system.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 22:01:17 -04:00
Theodore Ts'o 12aa7ad54e Suppress annoying missing field initializer warnings
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 21:39:37 -04:00
Theodore Ts'o 1dc16b0b95 Move the profile parsing functions from e2fsck to lib/support
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>
2015-07-12 21:39:31 -04:00
Theodore Ts'o 273c2c5dfd tune2fs: allow tune2fs to be built as a static library for Android
Sync up with aosp's e2fsprogs commits:

    d25948b9b4a9e361ef071dc8175df0407f60b7e0
    e59f7c7cedb1e07eb4dbbb66e115c14faea19f19

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 20:21:17 -04:00
Theodore Ts'o 1bf3f386f3 gen-android-files: implement 'Add MODULE_LICENSE and NOTICE files"
Sync up with aosp's e2fsprogs commits:

    e1b2879841453d799dc6077f857c5c9db5e83fee
    e64b83185148d359b9b6cc1310172a3c213a61fb
    b823193090c770fe79507df2413a825250b1dcd2
    9652dd6589d10675573c9a0acc90f6df5ac33397
    a5f85097aed09890d03dba31f9d18db75ce50cd7

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 18:09:14 -04:00
Theodore Ts'o 4ac4a41b8b android_config: remove HAVE_TERMIO_H
Sync up with aosp's e2fsprogs commits:

    dc351db427e667b9f954c4338f69da83fa16222b
    2ca3c65991609bb5b48004ec3c7a66f6b417beed
    4ef951aa5e69116963f1836fe5ddcf6b87afbecd

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 16:56:39 -04:00
Theodore Ts'o 0a332f42f9 Add fallocate.c to lib/exte2fs/Android.mk
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 16:10:58 -04:00
Theodore Ts'o f34af41b72 rename libquota.a to libsupport.a
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>
2015-07-12 16:09:22 -04:00
Theodore Ts'o 9e8fcd6e01 configure: remove support to disable quota support
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>
2015-07-03 22:02:30 -04:00
Theodore Ts'o 149640fabc configure: remove support to disable htree support
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>
2015-07-03 16:29:35 -04:00
Theodore Ts'o 44dfb37829 configure: only include libuuid and libblkid in AC_OUTPUT if needed
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>
2015-07-01 19:42:05 -04:00
Theodore Ts'o 59a220dd9f Fix "make clean" and "make distclean"
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>
2015-07-01 19:40:23 -04:00
Theodore Ts'o 8f8511aba0 libext2fs: fix gcc -Wall nits
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-06-21 20:15:52 -04:00
Theodore Ts'o 9603da15cb Revert "debugfs: add the hexdump_block command"
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>
2015-06-21 20:14:32 -04:00
Theodore Ts'o 6ece39e173 update config.{guess,sub,rpath} from FSF and gettext
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-06-20 22:10:10 -04:00
Theodore Ts'o 0fe40211b4 Merge branch 'maint' into next 2015-06-20 22:01:26 -04:00
Phillip Susi 8815116d1d tune2fs.8: update maximum journal size
The man page for tune2fs still listed the upper limit for the journal
as 102,400 blocks.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-06-20 15:43:39 -04:00
Theodore Ts'o 5ea7aee425 rename configure.in to configure.ac
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>
2015-06-20 14:33:24 -04:00
Theodore Ts'o f5dffb8132 configure: use system libraries for blkid and uuid if present
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>
2015-06-20 14:20:14 -04:00
Theodore Ts'o 58b0356a25 debugfs: add the hexdump_block command
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-06-20 00:10:20 -04:00
Theodore Ts'o 83c799dea0 Merge branch 'maint' into next 2015-06-19 22:01:16 -04:00
Konstantin Khlebnikov f7e37e8b95 debugfs: fix several errors and add assertions in the set_fields command
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>
2015-06-19 21:54:09 -04:00
Andreas Dilger a6eeac1ceb mke2fs: prompt for user verification for "-S"
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>
2015-06-19 21:34:02 -04:00
Andreas Dilger 59707c1b58 misc: fix alignment warnings on ARM
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>
2015-06-19 21:33:19 -04:00
Andreas Dilger 23cb84c547 tests: skip large filesystem tests on MacOS
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>
2015-06-19 21:31:26 -04:00
Theodore Ts'o 74f2c4aa18 fix diet libc build breaks for e4crypt and fallocate
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>
2015-06-19 19:28:25 -04:00
Theodore Ts'o 6f5bb811e8 e2fsck: skip checking the journal fields if the file system is mounted
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>
2015-06-19 18:14:33 -04:00
Theodore Ts'o dc810decfa Merge branch 'maint' into next 2015-06-15 23:16:24 -04:00
Theodore Ts'o 823c245e0d misc: fix bugs which broke misc/Makefile.in's "make depend"
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>
2015-06-15 15:22:01 -04:00
Richard Yao 97e9b97076 misc: remove broken whole device check
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>
2015-06-14 14:50:58 -04:00
Theodore Ts'o 58354a38e2 e4crypt: fix hexidecimal salt parsing
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-06-10 22:52:48 -04:00
Darrick J. Wong eeb2bb68f8 libext2fs: remove unnecessary undo file flush calls
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>
2015-06-10 20:08:33 -04:00
Darrick J. Wong 81cbf1ef4f misc: add fuse2fs, a FUSE server for e2fsprogs
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>
2015-06-10 20:07:48 -04:00