Whamcloud - gitweb
tools/e2fsprogs.git
5 years agoRemove debian patches for v1.44.4 release debian/1.44.5-1
Theodore Ts'o [Sun, 16 Dec 2018 05:54:28 +0000 (00:54 -0500)]
Remove debian patches for v1.44.4 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoMerge tag 'v1.44.5' into debian/master
Theodore Ts'o [Sun, 16 Dec 2018 05:52:33 +0000 (00:52 -0500)]
Merge tag 'v1.44.5' into debian/master

v1.44.5

5 years agoUpdate release notes, etc., for the 1.44.5 release v1.44.5
Theodore Ts'o [Sun, 16 Dec 2018 04:05:58 +0000 (23:05 -0500)]
Update release notes, etc., for the 1.44.5 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: create changelog for v1.44.5
Theodore Ts'o [Sat, 15 Dec 2018 18:15:10 +0000 (13:15 -0500)]
debian: create changelog for v1.44.5

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: fix up libext2fs-dev.doc-base
Theodore Ts'o [Sun, 16 Dec 2018 04:21:58 +0000 (23:21 -0500)]
debian: fix up libext2fs-dev.doc-base

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoAOSP: ODR violation in tune2fs during host build
Mark Salyzyn [Thu, 25 Oct 2018 20:00:51 +0000 (13:00 -0700)]
AOSP: ODR violation in tune2fs during host build

Port of commit 3271c69c97f486914fea833a36eaf5d86938c76d as applied to
e2fsck, but to tune2fs.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Bug: 112062612
Bug: 111302946
Test: $ m SANITIZE_HOST=address out/host/linux-x86/bin/tune2fs
      $ out/host/linux-x86/bin/tune2fs --help
Change-Id: If49d367d96b7bfd0b8b79c6bde23c0ded52ca683
From AOSP commit: 1cb5de330e5d1e0c6f587945ec065b995cc1c84b

5 years agoe2fsck: use "Optimize?" prompt for PR_1E_CAN_{COLLAPSE,NARROW}_EXTENT_TREE
Theodore Ts'o [Sun, 16 Dec 2018 03:13:41 +0000 (22:13 -0500)]
e2fsck: use "Optimize?" prompt for PR_1E_CAN_{COLLAPSE,NARROW}_EXTENT_TREE

If e2fsck can optimize an inode's extent tree, it should ask for
permission to optimize it, not to "fix" it.  This was causing some
confusion, since some users interpreted this prompt as an indication
that the file system was inconsistent.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: update to Debian policy 4.2.1
Theodore Ts'o [Sat, 15 Dec 2018 17:05:16 +0000 (12:05 -0500)]
debian: update to Debian policy 4.2.1

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe4defrag: use 64-bit counters to track # files defragged
Theodore Ts'o [Sat, 15 Dec 2018 15:08:42 +0000 (10:08 -0500)]
e4defrag: use 64-bit counters to track # files defragged

Addresses-Debian-Bug: 888899

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agomisc: fix groff formatting nits in man pages
Bjarni Ingi Gislason [Tue, 11 Dec 2018 01:49:22 +0000 (01:49 +0000)]
misc: fix groff formatting nits in man pages

Change a two-fonts macro to a one-font one, when there is only one
genuine argument.

Separate a punctuation mark or a section number from the only argument
to make two for a two-fonts macro.

Remove an unneeded escape in front of a horizontal tab character.

Correct the unit for distance from 'in' to 'i'.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: fix location of libext2fs documentation
Theodore Ts'o [Wed, 12 Dec 2018 03:20:52 +0000 (22:20 -0500)]
debian: fix location of libext2fs documentation

Addresses-Debian-Bug: #915942
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibext2fs: fix regression so we are correctly translating Posix ACL's
Theodore Ts'o [Fri, 7 Dec 2018 03:44:45 +0000 (22:44 -0500)]
libext2fs: fix regression so we are correctly translating Posix ACL's

The commit 50d0998cfee ("libext2fs: add ea_inode support to set
xattr") broke the fix that was addressed in commit 0ee1eaf70c25
("libext2fs: translate internal ext4 acl to Posix ACL in
ext2fs_xattr_[sg]et()").  This was because although we calculated what
the correct on-disk ACL representation would be, we didn't actually
*store* it, but instead stored the passed-in Posix ACL memory
representation instead.

Addresses-Launchpad-Bug: #1807288
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2freefrag: fix free blocks count during live scan
Darrick J. Wong [Thu, 8 Nov 2018 18:44:31 +0000 (10:44 -0800)]
e2freefrag: fix free blocks count during live scan

In e2freefrag live scan mode, we take the free block count from the
ondisk superblock.  This leads to screwy histogram percentages:

Extent Size Range :  Free extents   Free Blocks  Percent
    4M...    8M-  :             5          8234    1.05%
   64M...  128M-  :             2         52279    6.64%
  512M... 1024M-  :             1        202752   25.74%

...because there could be superblock updates in the journal that haven't
yet been checkpointed.  The online scan is perfectly capable of tallying
the free blocks on its own, so teach it do that and make a more accurate
report.

Reported-by: Elana Hashman <Elana.Hashman@twosigma.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotune2fs: fix false warning that a UUID change will take a long time
Theodore Ts'o [Sat, 24 Nov 2018 03:34:31 +0000 (22:34 -0500)]
tune2fs: fix false warning that a UUID change will take a long time

If the file system only has the flex_bg feature enabled (with out the
metadata_csum feature enabled), it won't take a long time time fix up
the checksums after changing the UUID.  While it does need to
recalculate all of the checksums in the block group descriptors, that
doesn't take a long time.

Also, if the ea_data feature is enabled, changing the UUID will also
take a long time, and we weren't warning the user about that case.

Fix up the warning message so it doesn't mislead people, and is more
accurate.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agomk_cmds: don't use explicit pathname for sed
Theodore Ts'o [Thu, 22 Nov 2018 23:01:56 +0000 (18:01 -0500)]
mk_cmds: don't use explicit pathname for sed

$AWK doesn't use an explicit pathname, and it's perfectly fine to
assume that awk and sed are in the user's PATH.  The problem with
using an explicit pathname is that Debian currently allows merged and
non-merged /usr.  Avoid using an explicit pathname to prevent
potential problems.

Addresses-Debian-Bug: #914087
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: check xattr 'system.data' before setting inline_data feature
Li Dongyang [Tue, 13 Nov 2018 04:46:03 +0000 (15:46 +1100)]
e2fsck: check xattr 'system.data' before setting inline_data feature

ext2fs_inline_data_size will happy return 0 and set size to
EXT4_MIN_INLINE_DATA_SIZE even when inode doesn't have
xattr 'system.data', a corrupted i_flags could make e2fsck
enable the inline_data on the superblock.

We should only offer to enable inline_data when i_flags is set
and xattr 'system.data' can be found.

Also use correct prompt for PR_1_INLINE_DATA_FEATURE.

Signed-off-by: Li Dongyang <dongyangli@ddn.com>
5 years agoe4defrag: handle failure to open the file system gracefully
Theodore Ts'o [Sun, 21 Oct 2018 11:35:53 +0000 (07:35 -0400)]
e4defrag: handle failure to open the file system gracefully

If e4defrag is run by root, it will try to open the underlying file
system for files that it is trying to defrag so it can get the file
system parameters.  It's currently doing this by searching /etc/mtab.
This isn't the best way to go about doing things, but we'll leave it
for now, at least for a maintenance release.  (The better way to do
things would be to look up the device using the blkid library, but
that's a more involved change.)

Since the file system parameters isn't strictly speaking necessary
(after all we get by without them when not running as root), we'll
allow e4defrag to continue running if we can't find the file system.
This can happen if /etc/mtab is pointing at /proc/mounts, and the
kernel can't properly identify the root file system, it is reported as
"/dev/root".

Addresses-Debian-Bug: #907634

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: move inode and its interior extent tree block
Theodore Ts'o [Sat, 20 Oct 2018 14:11:21 +0000 (10:11 -0400)]
tests: move inode and its interior extent tree block

Add a test case for the bug fixed in 4b3038134baf: "resize2fs: update
checksums in the extent tree's relocated block"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoresize2fs: update checksums in the extent tree's relocated block
Theodore Ts'o [Sat, 20 Oct 2018 13:14:48 +0000 (09:14 -0400)]
resize2fs: update checksums in the extent tree's relocated block

When shrinking an file system, and we need to relocate an inode, the
checksums in its extent tree must get updated to reflect its new inode
number.  When doing this, we need to do this *after* we update the
extent tree to reflect any blocks which need to be relocated due to
the file system shrink operation.

Otherwise, in the case where only an interior node of the extent tree
needs to get relocated, and none of the entries in that node need to
be adjusted, the checksum for that interior node is updated in the old
copy of that block, and then after the extent tree is updated to use
the new copy of that interior node, the extent tree is left with an
invalid checksum.

This is a relatively rare case, since it requires the following
conditions to be true:

*)  The metadata checksum feature must be enabled.
*)  An inode needs to be relocated.
*)  The inode needs to have an interior node.
*)  The block for that interior node needs to be relocated.
*)  None of blocks addressed by entries in that interior node needs
    to be relocated.

When all of these conditions are true, though, the file system is left
with corrupted with bad checksum for the extent tree block.

Addresses-Launchpad-Bug: 1798562

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reported-by: Jean-Baptiste Lallement <jean-baptiste.lallement@ubuntu.com>
5 years agofuse2fs: fix fsname option in some cases
Nicholas Clark [Tue, 16 Oct 2018 19:34:20 +0000 (15:34 -0400)]
fuse2fs: fix fsname option in some cases

FUSE's parser allows command-line options to be specified before
or after the device/image and mount-path. This commit changes the
value of the fsname mount option to be correct even if options are
specified before the target device/image.

Signed-off-by: Nicholas Clark <nicholas.clark@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoblkid: adjust copyright license for version.c to be LGPL
Theodore Ts'o [Tue, 16 Oct 2018 16:53:36 +0000 (12:53 -0400)]
blkid: adjust copyright license for version.c to be LGPL

This makes the license of version.c to be consistent with the rest of
the files in the library.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoAOSP: android/perms.c: clean up error handling
Nick Kralevich [Thu, 11 Oct 2018 03:35:17 +0000 (20:35 -0700)]
AOSP: android/perms.c: clean up error handling

There are a number of error conditions which, due to the way
ext2fs_dir_iterate2 operates, would not be propagated to the upper
layers of the call stack. As a result, certain error conditions,
such as not having enough room to allocate blocks for SELinux
labels, would fail silently, instead of causing a compile
failure.

As suggested in
https://android-review.googlesource.com/c/platform/external/e2fsprogs/+/324363
, add a error field to the caller's private data structure, and use the
bit in the field to indicate an error condition. Now, certain errors
which were silently ignored will cause a compile failure when compiling
Android.

Test: Artifically modify selabel_lookup() to return a failure, and
      verify Android doesn't compile.
Test: Verify Android compiles under normal circumstances.
Test: Artifically modify ino_add_xattr() to return a failure, and
      verify Android doesn't compile.
Bug: 117502873
Bug: 117567573
Bug: 117473440

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Change-Id: Icdb0105a77e98c3428f20d3c59bf824dcad5db8d
From AOSP commit: 7ca13b8b2953f93536ea09eb2ff19bd7cc85b3c1

5 years agoAOSP: Fix debugfs clang build.
David Anderson [Thu, 11 Oct 2018 19:36:34 +0000 (12:36 -0700)]
AOSP: Fix debugfs clang build.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Change-Id: Ic4de282039524e1858bbd288e2b85be30d843f40
From AOSP commit: 7e9e2ca4b08aab41b28e57d0c9b840b8b9e6466d

5 years agoAOSP: ODR violation in resize2fs during host build
Jiyong Park [Tue, 18 Sep 2018 00:41:07 +0000 (09:41 +0900)]
AOSP: ODR violation in resize2fs during host build

Bug: 112062612
Test: $ m SANITIZE_HOST=address $OUT_DIR/host/linux-x86/bin/resize2fs $OUT_DIR/host/linux-x86/bin/llvm-symbolizer
      $ $OUT_DIR/host/linux-x86/bin/resize2fs

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Change-Id: I72a8c183eb887137e3a414043b3d54771aa4eedc
From AOSP commit: 9ba4dd69cfbf312c6015d5b007566e2467203f5e

5 years agoe2fsck: clear clang warnings for missing field initializers in structs
Theodore Ts'o [Thu, 11 Oct 2018 14:25:31 +0000 (10:25 -0400)]
e2fsck: clear clang warnings for missing field initializers in structs

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotest_one: make sure the tmpfile is cleaned up if the test script exits
Theodore Ts'o [Thu, 11 Oct 2018 02:56:12 +0000 (22:56 -0400)]
test_one: make sure the tmpfile is cleaned up if the test script exits

f_detect_junk will skip the test by exiting; and in that case we need
to make sure the test's tmpfile gets cleaned up.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoDefine __GNUC_PREREQ if necessary
Theodore Ts'o [Thu, 11 Oct 2018 02:25:54 +0000 (22:25 -0400)]
Define __GNUC_PREREQ if necessary

The __GNUC_PREREQ convenience macro is defined by glibc's header
files.  If it isn't available, make it available for us to use.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agofilefrag.c: fix build problem when using musl libc
Theodore Ts'o [Thu, 11 Oct 2018 02:24:01 +0000 (22:24 -0400)]
filefrag.c: fix build problem when using musl libc

Use HAVE_LINUX_FD_H guard since not all libc's or operating systems
provide <linux/fd.h>.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibe2p: avoid segfault when s_nr_users is too high
Lukas Czerner [Tue, 14 Aug 2018 14:37:53 +0000 (16:37 +0200)]
libe2p: avoid segfault when s_nr_users is too high

Currently in e2fsprogs tools it's possible to access out of bounds
memory when reading list of ids sharing a journal log
(journal_superblock_t->s_users[]) in case where s_nr_users is too high.

This is because we never check whether the s_nr_users fits into the
restriction of JFS_USERS_MAX. Fix it by checking that nr_users is not
bigger than JFS_USERS_MAX and error out when possiblem.

Also add test for dumpe2fs. The rest would require involving external
journal which is not possible to test with e2fsprogs test suite at the
moment.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoFor --enable-subset, change "make install" so it implies "make install-libs"
Theodore Ts'o [Fri, 24 Aug 2018 21:12:20 +0000 (17:12 -0400)]
For --enable-subset, change "make install" so it implies "make install-libs"

The e2fsprogs-libs-1.44.x.tar.gz subset distribution had a hack so
that "make install" would install the libraries via an implied "make
install-libs" --- since after all the tarball had was just the
libraries.

This commit makes "make install" behave the same was as the
e2fsprogs-libs distribution in the case of "configure --enable-subset"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: update changelog for 1.44.4-2 release
Theodore Ts'o [Tue, 21 Aug 2018 15:32:30 +0000 (11:32 -0400)]
debian: update changelog for 1.44.4-2 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: update changelog for 1.44.4-2 release debian/1.44.4-2
Theodore Ts'o [Tue, 21 Aug 2018 15:32:30 +0000 (11:32 -0400)]
debian: update changelog for 1.44.4-2 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: remove hard-coded dependency for libss2 in e2fsprogs.shlibs.local
Theodore Ts'o [Wed, 22 Aug 2018 20:33:10 +0000 (16:33 -0400)]
debian: remove hard-coded dependency for libss2 in e2fsprogs.shlibs.local

The hard-coded override is very old, and isn't necessary --- in fact,
it's actively harmful because we are using one or two symbols that
were added to libss2 after e2fsprogs 1.34.   So remove it.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: fix up libcom-err2's version dependency handling
Theodore Ts'o [Wed, 22 Aug 2018 18:55:22 +0000 (14:55 -0400)]
debian: fix up libcom-err2's version dependency handling

We renamed libcomerr2 to libcom-err2 in 1.43.9.  So generating
dependencies of the form libcom-err2 (>= 1.34) don't really make any
sense.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoAdd patch: Make sure all release note files have a single trailing empty line
Theodore Ts'o [Wed, 22 Aug 2018 05:00:10 +0000 (01:00 -0400)]
Add patch: Make sure all release note files have a single trailing empty line

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: update to debian policy 4.2.0
Theodore Ts'o [Wed, 22 Aug 2018 00:12:08 +0000 (20:12 -0400)]
debian: update to debian policy 4.2.0

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: create NEWS.gz in /usr/share/doc/e2fsprogs
Theodore Ts'o [Wed, 22 Aug 2018 00:10:02 +0000 (20:10 -0400)]
debian: create NEWS.gz in /usr/share/doc/e2fsprogs

Create the full NEWS.gz and put it in /usr/share/doc/e2fsprogs instead
of the RELEASE-NOTES file to comply with the Debian policy 4.2.0.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: remove hard-coded dependency for libss2 in e2fsprogs.shlibs.local
Theodore Ts'o [Wed, 22 Aug 2018 20:33:10 +0000 (16:33 -0400)]
debian: remove hard-coded dependency for libss2 in e2fsprogs.shlibs.local

The hard-coded override is very old, and isn't necessary --- in fact,
it's actively harmful because we are using one or two symbols that
were added to libss2 after e2fsprogs 1.34.   So remove it.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: fix up libcom-err2's version dependency handling
Theodore Ts'o [Wed, 22 Aug 2018 18:55:22 +0000 (14:55 -0400)]
debian: fix up libcom-err2's version dependency handling

We renamed libcomerr2 to libcom-err2 in 1.43.9.  So generating
dependencies of the form libcom-err2 (>= 1.34) don't really make any
sense.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: update to debian policy 4.2.0
Theodore Ts'o [Wed, 22 Aug 2018 00:12:08 +0000 (20:12 -0400)]
debian: update to debian policy 4.2.0

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: create NEWS.gz in /usr/share/doc/e2fsprogs
Theodore Ts'o [Wed, 22 Aug 2018 00:10:02 +0000 (20:10 -0400)]
debian: create NEWS.gz in /usr/share/doc/e2fsprogs

Create the full NEWS.gz and put it in /usr/share/doc/e2fsprogs instead
of the RELEASE-NOTES file to comply with the Debian policy 4.2.0.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoFix "make install" for configure --enable-subset
Theodore Ts'o [Wed, 22 Aug 2018 17:42:23 +0000 (13:42 -0400)]
Fix "make install" for configure --enable-subset

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoMake sure all release note files have a single trailing empty line
Theodore Ts'o [Wed, 22 Aug 2018 04:52:08 +0000 (00:52 -0400)]
Make sure all release note files have a single trailing empty line

This is needed so we can assemble a complete release notes file via a
command like:

cat $(/bin/ls -1 doc/RelNotes/v*.txt | tac) | gzip -9n > NEWS.gz

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2image: copy mmp block when create metadata only image
Artem Blagodarenko [Tue, 21 Aug 2018 19:58:41 +0000 (22:58 +0300)]
e2image: copy mmp block when create metadata only image

e2image in modes without data blocks copy (-r, -Q) doesn't copy
mmp block that leads to fsck error:

Superblock has invalid MMP magic.  Fix? no

This patch adds coping this block if mmp is enabled.

Change-Id: I66035ee394a0ff53b9959e82b3e47050f3bf1593
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoCherry-pick "e2fsck: allow verity files to have initialized blocks past i_size"
Theodore Ts'o [Tue, 21 Aug 2018 20:27:51 +0000 (16:27 -0400)]
Cherry-pick "e2fsck: allow verity files to have initialized blocks past i_size"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: allow verity files to have initialized blocks past i_size
Eric Biggers [Tue, 21 Aug 2018 17:59:37 +0000 (10:59 -0700)]
e2fsck: allow verity files to have initialized blocks past i_size

Since ext4 verity is going to be an RO_COMPAT feature rather than an
INCOMPAT one, the on-disk i_size of verity inodes needs to be the data
size rather than the full size.  Consequently, verity inodes will have
initialized blocks past i_size, containing the Merkle tree and other
verity metadata.  So e2fsck must not fix the i_size of such inodes as it
normally would.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoRediff patches for 1.44.4-2 release
Theodore Ts'o [Tue, 21 Aug 2018 14:55:07 +0000 (10:55 -0400)]
Rediff patches for 1.44.4-2 release

Add 0001-tune2fs-fix-dereference-of-freed-memory-after-journa.patch
Add 0002-libe2p-fix-verity-flag-bit.patch
Add 0003-libext2fs-add-verity-flag-to-EXT2_LIB_FEATURE_RO_COM.patch

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibext2fs: add verity flag to EXT2_LIB_FEATURE_RO_COMPAT_SUPP
Eric Biggers [Tue, 21 Aug 2018 00:15:52 +0000 (17:15 -0700)]
libext2fs: add verity flag to EXT2_LIB_FEATURE_RO_COMPAT_SUPP

The new ro_compat filesystem feature flag for fs-verity was added to
EXT2_FEATURE_RO_COMPAT_SUPP, but that's not actually used by e2fsprogs
itself.  So contrary to the v1.44.4 release notes, 'mke2fs -O verity'
doesn't actually work, nor does e2fsck allow the filesystem to have the
verity feature.  Fix it by adding the flag to the correct place
(EXT2_LIB_FEATURE_RO_COMPAT_SUPP) too.

Fixes: faae7aa00df0 ("Reserve codepoints for the fsverity feature.")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibe2p: fix verity flag bit
Eric Biggers [Mon, 20 Aug 2018 23:37:37 +0000 (16:37 -0700)]
libe2p: fix verity flag bit

The verity flag was mapped to EXT4_PROJINHERIT_FL, presumably due to a
copy+paste error.  Fix it.

Fixes: faae7aa00df0 ("Reserve codepoints for the fsverity feature.")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotune2fs: fix dereference of freed memory after journal replay
Theodore Ts'o [Sun, 19 Aug 2018 20:46:04 +0000 (16:46 -0400)]
tune2fs: fix dereference of freed memory after journal replay

This can be found by running the test t_replay_and_set under valgrind.

Reported-by: Chris Clayton <chris2553@googlemail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoMerge tag 'v1.44.4' into debian/master debian/1.44.4-1
Theodore Ts'o [Sun, 19 Aug 2018 02:50:55 +0000 (22:50 -0400)]
Merge tag 'v1.44.4' into debian/master

v1.44.4

5 years agoUpdate release notes, etc., for the 1.44.4 release v1.44.4
Theodore Ts'o [Sun, 19 Aug 2018 01:14:56 +0000 (21:14 -0400)]
Update release notes, etc., for the 1.44.4 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: add configuration file for git-buildpackage
Theodore Ts'o [Sun, 19 Aug 2018 02:25:05 +0000 (22:25 -0400)]
debian: add configuration file for git-buildpackage

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: declare that the debian packaging will be found in debian/master
Theodore Ts'o [Sun, 19 Aug 2018 02:19:35 +0000 (22:19 -0400)]
debian: declare that the debian packaging will be found in debian/master

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: fix where docs are installed in the comerr-dev and ss-dev packages
Theodore Ts'o [Sun, 19 Aug 2018 02:14:11 +0000 (22:14 -0400)]
debian: fix where docs are installed in the comerr-dev and ss-dev packages

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoAOSP: e2fsdroid: Set android_configure when product out is passed.
Sen Jiang [Mon, 13 Aug 2018 18:09:21 +0000 (11:09 -0700)]
AOSP: e2fsdroid: Set android_configure when product out is passed.

The only place that's using |product_out| is android_configure_fs().

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Bug: 111439984
Test: generated image has correct permission
Change-Id: I2602686b6b92c3e61a541b8794d266b1ee6a00d1
From AOSP commit: 57c92af0ac608dbb27de9f882336e28de7bb1fa2

5 years agoAOSP: Ignore quotes in safe_print().
Jeff Sharkey [Fri, 1 Jun 2018 16:49:40 +0000 (10:49 -0600)]
AOSP: Ignore quotes in safe_print().

If the value being printed has embedded quotes ("), then printing
those quotes could confuse other tools when parsing the value.

This is the simplest CL to fix the security issue, and we can circle
back to think about more robust escaping in a future CL.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Bug: 80436257
Test: manual
Change-Id: Ica17f2c5701573bceafe34f20110d230a3925483
From AOSP commit: efe90c297a8df591c051fdbfacb92b5283390bba

5 years agoAOSP: blkid: Correct the label name for exfat
Upendra [Thu, 1 Mar 2018 08:15:48 +0000 (17:15 +0900)]
AOSP: blkid: Correct the label name for exfat

Volume label name is 16 bit unicode string according to spec.
Currently blkid labels the device without converting it to
utf-8 chars due to which incorrect label is displayed.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Bug: 74184636
Test: manual
Change-Id: Ib16204c75c2cdf675d480e9c66f484bb3c51108e
From AOSP commit: 25715073b170970469126426196c9e5084613c37

5 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Sat, 18 Aug 2018 18:28:35 +0000 (14:28 -0400)]
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agopo: update es.po (from translationproject.org)
Antonio Ceballos [Sat, 18 Aug 2018 18:28:35 +0000 (14:28 -0400)]
po: update es.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agopo: update da.po (from translationproject.org)
Joe Hansen [Sat, 18 Aug 2018 18:28:35 +0000 (14:28 -0400)]
po: update da.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibext2fs: fix uninitialized length in rep_strdup()
Theodore Ts'o [Sat, 18 Aug 2018 17:29:41 +0000 (13:29 -0400)]
libext2fs: fix uninitialized length in rep_strdup()

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>
5 years agoDrop subset tarball and replace it with "configure --enable-subset"
Theodore Ts'o [Sat, 18 Aug 2018 15:19:25 +0000 (11:19 -0400)]
Drop subset tarball and replace it with "configure --enable-subset"

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>
5 years agoStop generating e2fsprogs.spec automatically
Theodore Ts'o [Sat, 18 Aug 2018 14:42:44 +0000 (10:42 -0400)]
Stop generating e2fsprogs.spec automatically

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>
5 years agoRemove obsolete files from the repository
Theodore Ts'o [Sat, 18 Aug 2018 13:55:26 +0000 (09:55 -0400)]
Remove obsolete files from the repository

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>
5 years agogen-tarball: handle symlinks correctly in the created the tar file
Theodore Ts'o [Sat, 18 Aug 2018 04:06:40 +0000 (00:06 -0400)]
gen-tarball: handle symlinks correctly in the created the tar file

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>
5 years agoMerge tag 'v1.44.3' into debian-packaging
Theodore Ts'o [Sat, 18 Aug 2018 03:01:24 +0000 (23:01 -0400)]
Merge tag 'v1.44.3' into debian-packaging

v1.44.3

5 years agotests: mke2fs must not create fs with resize_inode and meta_bg
Lukas Czerner [Mon, 13 Aug 2018 13:17:06 +0000 (15:17 +0200)]
tests: mke2fs must not create fs with resize_inode and meta_bg

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>
5 years agotests: e2fsck must be able fix fs with resize_inode and meta_bg
Lukas Czerner [Mon, 13 Aug 2018 13:17:05 +0000 (15:17 +0200)]
tests: e2fsck must be able fix fs with resize_inode and meta_bg

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>
5 years agoReserve codepoints for the fsverity feature.
Theodore Ts'o [Tue, 14 Aug 2018 02:39:27 +0000 (22:39 -0400)]
Reserve codepoints for the fsverity feature.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: fix fd leak in reserve_stdio_fds
Theodore Ts'o [Sun, 12 Aug 2018 00:47:08 +0000 (20:47 -0400)]
e2fsck: fix fd leak in reserve_stdio_fds

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
5 years agoremove unused datarootdir
Lukas Czerner [Thu, 9 Aug 2018 08:35:45 +0000 (10:35 +0200)]
remove unused datarootdir

Remove unused datarootdir variable from compile_et and mk_cmds.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: remove resize inode if both resize_inode and meta_bg are enabled
Lukas Czerner [Wed, 8 Aug 2018 11:52:56 +0000 (13:52 +0200)]
e2fsck: remove resize inode if both resize_inode and meta_bg are enabled

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>
5 years agobuild: use MKDIR_P instead of MKINSTALLDIRS
Ross Burton [Thu, 10 Jul 2014 14:39:05 +0000 (15:39 +0100)]
build: use MKDIR_P instead of MKINSTALLDIRS

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibext2fs: support devices w/ non-512 byte block size on Apple Darwin
Fedor Uporov [Sun, 19 Mar 2017 19:29:26 +0000 (22:29 +0300)]
libext2fs: support devices w/ non-512 byte block size on Apple Darwin

Signed-off-by: Fedor Uporov <thisisadrgreenthumb@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoAOSP: ODR violation in e2fsck during host build
Isaac Chen [Fri, 3 Aug 2018 09:39:31 +0000 (17:39 +0800)]
AOSP: ODR violation in e2fsck during host build

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Bug: 112062612
Test: $ m SANITIZE_HOST=address $OUT_DIR/host/linux-x86/bin/e2fsck $OUT_DIR/host/linux-x86/bin/llvm-symbolizer
      $ $OUT_DIR/host/linux-x86/bin/e2fsck

Change-Id: I3f1a18d6d72116d864a79f0acef37625124f4c1a
From AOSP commit: 3271c69c97f486914fea833a36eaf5d86938c76d

5 years agoAOSP: Fix macOS build.
David Anderson [Wed, 25 Jul 2018 19:41:05 +0000 (12:41 -0700)]
AOSP: Fix macOS build.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Bug: 111839488
Test: e2fsprogs builds on macOS.
Change-Id: I4ddf332cc244fa44f928cba68470b7f9aa48a556
From AOSP commit: 4dc2456f0e6d10c73372e829e1875ec4095e8fa6

5 years agoAOSP: Update Android.bp files.
David Anderson [Thu, 12 Jul 2018 23:55:08 +0000 (16:55 -0700)]
AOSP: Update Android.bp files.

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 cabde4999d1d10b6ace32eaddc99699b91e40551.

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

5 years agoAOSP: e2fsck: Remove unused variable.
David Anderson [Mon, 16 Jul 2018 21:37:32 +0000 (14:37 -0700)]
AOSP: e2fsck: Remove unused variable.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Bug: N/A
Test: e2fsck builds
Change-Id: I48e33920d8aa369808fb47143f2a46ecaa03f6c3
From AOSP commit: 4d2e95e15a4df94e556c2bfbf77b7b1d8e43b446

5 years agoAOSP: Always define HAVE_SYS_SYSMACROS_H on Android.
David Anderson [Thu, 12 Jul 2018 21:59:11 +0000 (14:59 -0700)]
AOSP: Always define HAVE_SYS_SYSMACROS_H on Android.

This is needed after 3fb715b55426875902dfef3056b2cf7335953178 which
conditionally included sysmacros.h.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Change-Id: I52e3da4d9ea0f5efbf685a9c4a266f33357f8d8c
From AOSP commit: a5deff7b7ee15a5ba5d65516326ce4c42daa1027

5 years agoAOSP: Conditionally define __bitwise__ on Android.
David Anderson [Thu, 12 Jul 2018 19:22:22 +0000 (12:22 -0700)]
AOSP: Conditionally define __bitwise__ on Android.

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

5 years agodebugfs: fix ncheck so it handles hard links correctly
Jaco Kroon [Thu, 2 Aug 2018 18:06:46 +0000 (20:06 +0200)]
debugfs: fix ncheck so it handles hard links correctly

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>
5 years agodebian: stop using symlinks to save space on *-dev packages
Theodore Ts'o [Sun, 5 Aug 2018 01:06:19 +0000 (21:06 -0400)]
debian: stop using symlinks to save space on *-dev packages

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>
5 years agoresize2fs: Remove the real kilobytes rant from man page
Lukas Czerner [Thu, 19 Jul 2018 08:39:38 +0000 (10:39 +0200)]
resize2fs: Remove the real kilobytes rant from man page

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>
5 years agoAOSP: e2fsdroid: Fix crash with invalid command line args
David Anderson [Fri, 2 Mar 2018 23:38:38 +0000 (15:38 -0800)]
AOSP: e2fsdroid: Fix crash with invalid command line args

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

5 years agoe2fsprogs: fix non-three-char month in version.h
Lonnie Abelbeck [Wed, 18 Jul 2018 20:37:09 +0000 (15:37 -0500)]
e2fsprogs: fix non-three-char month in version.h

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoFix compile error and warnings for old gcc versions
Li Dongyang [Sat, 14 Jul 2018 00:42:48 +0000 (18:42 -0600)]
Fix compile error and warnings for old gcc versions

-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>
5 years agoblkid: avoid FPE crash when probing a HFS+ superblock with a zero blocksize
Theodore Ts'o [Tue, 10 Jul 2018 22:12:54 +0000 (18:12 -0400)]
blkid: avoid FPE crash when probing a HFS+ superblock with a zero blocksize

This problem was reported by Adam Buchbinder.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoUpdate release notes, etc., for the 1.44.3 release debian/1.44.3-1 v1.44.3
Theodore Ts'o [Tue, 10 Jul 2018 05:40:38 +0000 (01:40 -0400)]
Update release notes, etc., for the 1.44.3 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: update standards version to 4.1.5
Theodore Ts'o [Tue, 10 Jul 2018 05:14:26 +0000 (01:14 -0400)]
debian: update standards version to 4.1.5

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibext2fs: install hashmap.h since it is needed by libext2fs.h
Theodore Ts'o [Sun, 8 Jul 2018 15:52:53 +0000 (11:52 -0400)]
libext2fs: install hashmap.h since it is needed by libext2fs.h

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoUpdate release notes, etc., for the 1.44.3-rc2 release v1.44.3-rc2
Theodore Ts'o [Wed, 4 Jul 2018 13:46:45 +0000 (09:46 -0400)]
Update release notes, etc., for the 1.44.3-rc2 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Wed, 4 Jul 2018 13:11:41 +0000 (09:11 -0400)]
po: update uk.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Wed, 4 Jul 2018 13:11:41 +0000 (09:11 -0400)]
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Wed, 4 Jul 2018 13:11:41 +0000 (09:11 -0400)]
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Wed, 4 Jul 2018 13:11:40 +0000 (09:11 -0400)]
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Wed, 4 Jul 2018 13:11:40 +0000 (09:11 -0400)]
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibext2fs: call fsync(2) to clear stale errors for a new a unix I/O channel
Theodore Ts'o [Wed, 4 Jul 2018 04:23:10 +0000 (00:23 -0400)]
libext2fs: call fsync(2) to clear stale errors for a new a unix I/O channel

Newer versions of Linux will retain errors and allow them to be
returned by fsync() or close(), even if the error happened before the
file descriptor was opened.  This was to accomodate Postgres's
"interesting" method of error collection.

Unfortunately, for e2fsck, we never want to see stale errors, as this
can cause xfstests (such generic/347) to fail with a false positive.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: fix kernel compat functions to use kernel error return conventions
Theodore Ts'o [Wed, 4 Jul 2018 04:18:30 +0000 (00:18 -0400)]
e2fsck: fix kernel compat functions to use kernel error return conventions

Fix journal_bmap() and sync_blockdev() to use the kernel error
convetions (e.g., -EIO instead of EIO) since they are called by
reovery.c, which is shared userspace / kernel code.

Without this, e2fsck might print an error message like this:

/sbin/e2fsck: Unknown code ____ 251 while recovering journal of /dev/mapper/thin-vol

instead of what it should have printed which was this:

/sbin/e2fsck: Input/output error while recovering journal of /dev/mapper/thin-vol

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: make generated test scripts read-only
Andreas Dilger [Mon, 2 Jul 2018 21:06:32 +0000 (17:06 -0400)]
tests: make generated test scripts read-only

Make generated test scripts read-only, to avoid errors by developers
editing the generated test scripts and then having them accidentally
clobbered when "make" is run again.

Change-Id: I60d417b816b7c559b5e05baf4167fc2cf2a871cf
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>