Commit Graph

1509 Commits (master)

Author SHA1 Message Date
Vitaliy Filippov b3782b2e5b Add e2patch utility 2016-09-16 11:54:35 +03:00
Vitaliy Filippov 2051d63a83 misc: Return error if file is too big for FIBMAP 2016-09-16 11:02:45 +03:00
Theodore Ts'o a2143b5160 Fix build reproducibility for mk_cmds and compile_et
The mk_cmds and compile_et scripts include the build directory, which
breaks the build reproducibility goal of Debian.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 22:25:22 -04:00
Theodore Ts'o 4d4335323e tune2fs: tell the user that e2fsck -f is required
The message requesting that the user run e2fsck doesn't include the -f
option, and this is needed to force a file system check.

Addresses-Debian-Bug: #828022

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:53 -04:00
Theodore Ts'o 9a23fa8334 Merge branch 'maint' into next 2016-08-10 18:53:14 -04:00
Andreas Dilger 713edbd082 fsck: fix strange logic
llvm warns about the confusingly written comparison:

                              !strncmp(argv[i+1], "-", 1) == 0) {
    misc/fsck.c:1178 col 9: warning: logical not is only applied to
      the left hand side of comparison [-Wlogical-not-parentheses]
    misc/fsck.c:1178 col 9: note: add parentheses after the '!' to
      evaluate the comparison first
    misc/fsck.c:1178 col 9: note: add parentheses around left hand
      side expression to silence this warning

It makes sense to simplify this to a character comparison rather
than using strncmp() to check only one character.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-08-10 18:21:19 -04:00
Matthias Andree c2c5c58593 libext2fs: fix infinite loop if copying in an empty directory
In m_minrootdir, on FreeBSD 9.3, try_lseek_copy() fails on an empty file
because errcode is uninitialized and the while() loop never executes,
and the errcode garbage is returned.

Initialize errcode = 0 in try_lseek_copy() to avoid a "fail" result when
there was nothing to copy.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-07-23 12:40:17 -04:00
Gustavo Zacarias 49aa3ff1f1 fuse2fs: needs SYSLIBS
It otherwise leads to build failure when using an unbundled libintl.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-07-05 22:59:45 -04:00
Eric Sandeen 32bf36dc0f e2undo: fix endian issues
Two new e2undo issues exist in the latest release on big endian
machines.

From sparse check:

undo_io.c:157:26: warning: invalid assignment: |=
undo_io.c:157:26:    left side has type restricted __le32
undo_io.c:157:26:    right side has type int
undo_io.c:161:26: warning: invalid assignment: &=
undo_io.c:161:26:    left side has type restricted __le32
undo_io.c:161:26:    right side has type int

e2undo.c:211:16: warning: cast to restricted __le64
e2undo.c:211:16: warning: cast from restricted blk64_t
e2undo.c:212:16: warning: cast to restricted __le64
e2undo.c:212:16: warning: cast from restricted blk64_t

Addresses-RedHat-Bugzilla: 1344636
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-21 23:10:40 -04:00
Ingo Brückl 7bd03cf6a1 misc: don't unconditionally install manual page for fuse2fs
Only install the manual page if fuse2fs itself will be installed.

Signed-off-by: Ingo Brückl <ib@wupperonline.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-09 16:56:50 -04:00
Gustavo Zacarias 62bc243f1b fuse2fs: might need librt
It uses clock_gettime() which in older glibc versions is in librt.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-09 16:56:15 -04:00
Theodore Ts'o c0495d96fd Remove the last of behaviour-specific checks on EXT2_OS_LINUX
If there is a feature check, we can just depend on the feature check.
If it is something that can't be checked via a feature flag, then
instead of checking for EXT2_OS_LINUX, we should instead check for
*NOT* EXT2_OS_HURD. since HURD is the special case.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-07 13:36:47 -04:00
Theodore Ts'o 81f965a04d tune2fs,resize2fs: special case HURD only when testing s_creator_os
The s_creator_os field was a mistake, given how Hurd has been
ab(using) certain file system fields.  We should skip support for
certain advanced features (64-bit support, metadata checksums) for
file systems created on the Hurd OS only, instead of only supporting
them for file systems created on Linux.  This fixes various regression
test failures for FreeBSD.

(The regression tests are probably mostly hopeless for Hurd anyway,
but given the HURD abuse's of various file system fields, the HURD is
going to have to be given second-class treatment in any case, given
what they decided to do with ext2 support, which locks them out of the
more advanced file system features, anyway.)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-07 11:47:40 -04:00
Theodore Ts'o 7618802123 e2undo: #include <libgen.h> since we use basename()
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-06 16:19:11 -04:00
Theodore Ts'o 2832fd8b8f mke2fs: warn if user provides a label which is too long
Addresses-Debian-Bug: #791630

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-05 23:18:30 -04:00
Theodore Ts'o 97b7a94679 Add clarifications to the e4defrag and resize2fs man pages
Addresses-Debian-Bug: #761144
Addresses-Debian-Bug: #770750

Signed-off-by: Theodore Ts'o <tytso@mit.edu>

by 1 commit.
2016-06-03 23:28:33 -04:00
Theodore Ts'o 50a6f4a2cf Document when ext2/3/4 features were added to the kernel
Document when ext2/3/4 features were added to the kernel in the
ext4(5) man page.

Addresses-Debian-Bug: #428361

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-03 23:09:58 -04:00
Pete Haddow f8a801d05f Clarify and clean up the ext4(5) man page
Signed-off-by: Pete Haddow <pete@leptonyx.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-03 13:44:41 -04:00
Theodore Ts'o 377e3a9657 misc: fix gcc -Wall complaints
Especially when compiling for a 32-bit architecture.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-02 22:40:41 -04:00
Theodore Ts'o 478360f50b Fix Android build warnings
Also fix some additional gcc -Wall build warnings in a traditional
Linux environment.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-29 23:51:08 -04:00
Theodore Ts'o a701823a31 libsupport: fix gcc -Wall nits
Also add better error checking to mke2fs and e2fsck's calls to quota
functions in libsupport.a.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-29 17:36:43 -04:00
Theodore Ts'o fd1677e801 Add --enable-hardening which builds e2fsprogs with security hardening
Enable the following security features: stack protection, fortify,
read-only relocation tables, immediate dynamic symbol binding, and
text segment ASLR by enabling position independent executable
(PIE).

Special handling is provided for shared library and statically linked
executables.  For all the gory details please see:

   https://lists.debian.org/debian-devel/2016/05/msg00302.html

Distributions who want to do their own special thing can set CFLAGS,
CFLAGS_SHLIB, CLFAGS_STLIB, LDFLAGS, LDFLAGS_SHLIB and LDFLAGS_STATIC
as appropriate.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-22 01:58:09 -04:00
Theodore Ts'o 78b7cd3b1e Clean up spelling errors and other nits in man pages
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-21 13:40:49 -04:00
Theodore Ts'o 0da058af9f mke2fs.conf: don't enable metadata_csum by default
For the 1.43 release, we will not be enabling the metadata_csum
feature by default.  We will leave that up to distribution vendors to
decide whether they want to be aggressive about enabling this feature
by default.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-17 01:32:58 -04:00
Theodore Ts'o 051fd4e028 misc: fix various Coverity warnings
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-17 00:53:47 -04:00
Marcus Huewe 0935fa8da3 e2undo: support the undo header's fs_offset feature
If the fs_offset feature is present (and no "-o offset"
option is specified), e2undo performs the undo operation at
the stored offset.

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-12 15:36:39 -04:00
Marcus Huewe 6930537d52 e2undo: add "-o offset" option to specify the filesystem offset
This is useful if the filesystem is located at an arbitrary
offset instead of the beginning of a device or file.

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-12 15:36:00 -04:00
Marcus Huewe dc01088db5 mke2fs: fix filesystem size calculation, if an offset is specified
If a filesystem size is explicitly specified, it should be used without
subtracting the offset.

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-12 15:25:14 -04:00
Theodore Ts'o b8d0b0e1f6 fuse2fs.1: fix man page section of fuse2fs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-12 00:02:07 -04:00
Theodore Ts'o d0e855fa47 misc: avoid PATH_MAX dependency in create_inode.c
Addresses-Debian-Bug: #822576

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-11 00:08:58 -04:00
Theodore Ts'o f9b16db868 More man page and usage message fixups
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-10 23:23:14 -04:00
Theodore Ts'o a039df9c4a mke2fs: support multiple -O options
Some users will get confused and try to specify multiple -O options.
So teach mke2fs to treat "-O feature1 -O feature2" as
"-O feature1,feature2".

https://bugzilla.kernel.org/show_bug.cgi?id=117421

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-10 17:41:08 -04:00
Theodore Ts'o bc8f1ae523 Fix various man pages and usage message
Thanks to pete@lyptonyx for doing a close pass editing of e2fsprogs's
man pages.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-08 22:18:51 -04:00
Theodore Ts'o a195e862ca mke2fs: fix the parsing used for -E quotatype=usrquota:grpquota:prjquota
Commit 2d2d799c72 tried to use parse_quota_options(), which uses
commas to separate out the quota types.  Unfortunately, when parsing
extended options, commands are used to separate different extended
options.

To fix this, I've add a new support function parse_quota_type(), which
allows either commas or colons to used as a separator character, and
which manipulates a bit field to indicate which quota types should be
enabled.  Eventually tune2fs should be converted to use
parse_quota_type() as well, thus obsoleting parse_quota_options(), but
that's a more complicated cleanup patch for later.

Fix a lint warning which could the number of blocks to be incorretly
printed if it exceeds 2**32.

Also fix some typos and other minor bugs in the usage message.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-08 21:25:55 -04:00
Theodore Ts'o 1973233e53 e4crypt: remove debugging code which broke the set_policy subcommand
Also fixed some spelling typos in help messages.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-06 23:38:33 -04:00
Theodore Ts'o 87d9b2fb9e mke2fs: adjust the default file system size by the offset
If the user specifies an offset using -E offset without specifying an
explicit size, the system will use the block device (or file) size as
the default file system size.  If we are using the default file system
size, subtract out the offset so the resulting file system will stay
within the block device.  Also print a warning that this might not be
what the user wants.

Addresses-Debian-Bug: #803629

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-05-01 00:57:19 -04:00
Theodore Ts'o a7dc56f45e mke2fs.8, badblocks.8: fix spelling errors and other miscellaneous typos
Reported-by: Pete <pete@leptonyx.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-04-30 22:00:54 -04:00
Darrick J. Wong 8feb6f439a fuse2fs: delete unused variables
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-04-25 14:53:24 -04:00
Darrick J. Wong 7dd0dfca04 e2image: ignore checksum errors
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>
2016-04-25 11:03:09 -04:00
Theodore Ts'o 1fc23b5e77 Fix support for configure --enable-jbd-debug
We haven't used this in a while, so it's bitrotted a bit.  Fix it up
so that it works correctly.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-04-15 19:01:38 -04:00
Theodore Ts'o 4ea40c0bc2 Merge branch 'maint' into next 2016-04-15 11:33:30 -04:00
Eric Sandeen be5ce27525 e2image: don't leak progress info to stdout
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>
2016-04-15 10:59:02 -04:00
Marcus Huewe cba3fd5ca1 mke2fs: fix for the "-E offset=N" option
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>
2016-03-26 22:26:40 -04:00
Theodore Ts'o 31ddef52ba Fix warnings caused by glibc 2.20
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>
2016-03-21 13:05:25 -04:00
Theodore Ts'o 25040c0431 chattr: fix verbose message while setting the project id
This was caused by a cut and paste error.  (Thanks to Coverity for
pointing this out).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 16:49:51 -04:00
Theodore Ts'o 9c05bb9fba tune2fs: don't include journal recovery when building for Android
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 16:07:34 -04:00
Theodore Ts'o dd9a866b08 fuse2fs.1: add manual page for fuse2fs
Also add libfuse-dev to the Debian build depends so that fuse2fs gets
built for Debian.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 15:23:35 -04:00
Theodore Ts'o 82e48fb163 Fix various clang and gcc -Wall warnings
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 12:45:19 -04:00
Alex Deymo 205593f65b Android.mk: Replace _host suffix with more standard -host suffix
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>
2016-03-15 01:25:11 -04:00
Alex Deymo 5eeb0cca33 libext2fs: export the library include path
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>
2016-03-14 18:39:48 -04:00