]> git.ipfire.org Git - thirdparty/e2fsprogs.git/log
thirdparty/e2fsprogs.git
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 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>
5 years agoe2fsck: if user declines to fix s_inodes_acount, abort
Theodore Ts'o [Fri, 29 Jun 2018 15:35:58 +0000 (11:35 -0400)] 
e2fsck: if user declines to fix s_inodes_acount, abort

A recent commit, d74eb7ef: "e2fsck: handle s_inodes_count corruption
properly" tries to fix s_inodes_count.  However, if the user declines
to fix the invalid s_inodes_count, e2fsck needs to abort since
otherwise we can crash due to the insane s_inodes_count.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: do not allow initialized blocks pass i_size
Lukas Czerner [Thu, 28 Jun 2018 13:59:09 +0000 (15:59 +0200)] 
e2fsck: do not allow initialized blocks pass i_size

We do not allow initialized blocks to exist past i_size as this could
lead to stale data exposure.

Remove test f_pgsize_gt_blksize because it is testing for the scenario
that not allowed. f_eofblocks is already testing for this.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: fix hang in readahead code if last block in fs is metadata
Theodore Ts'o [Thu, 28 Jun 2018 15:10:58 +0000 (11:10 -0400)] 
e2fsck: fix hang in readahead code if last block in fs is metadata

If the last block the file system is metadata (very rare, but it can
happen, especially if e2fsck needs to relocate a bitmap block), e2fsck
will hang while trying to do readahead.

This problem was reported by Adam Buchbinder.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoAOSP: e2fsdroid and mke2fs are dynamic executable in recovery partition
Jiyong Park [Wed, 20 Jun 2018 05:21:54 +0000 (14:21 +0900)] 
AOSP: e2fsdroid and mke2fs are dynamic executable in recovery partition

The two utilities are now converted to dynamic executables as shared
libraries are supported in recovery mode.

As part of the conversion, shared libraries that are depended from them
are also marked as recovery_available: true.

Bug: 79146551
Test: adb reboot recovery, and select 'Wipe data/factory reset'. The
data partition is formatted and there is no selinux denial.

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

5 years agotests, mke2fs: add option to suppress xattr copying to fix f_extent_htree
Theodore Ts'o [Tue, 26 Jun 2018 19:21:28 +0000 (15:21 -0400)] 
tests, mke2fs: add option to suppress xattr copying to fix f_extent_htree

If the developer is running with SELinux enabled on /tmp, the
f_extent_htree regression test will fail because mke2fs by default
copies the extended attributes into the newly created file system (if
a directory hierarchy is specified via the -d option).

Fix this by adding a new extended option to mke2fs, -E no_copy_xattrs
and using it in f_extent_htree's test script.

Reported-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: explicitly force resize2fs's use of lazy (or not)
Theodore Ts'o [Tue, 26 Jun 2018 13:59:19 +0000 (09:59 -0400)] 
tests: explicitly force resize2fs's use of lazy (or not)

Resize2fs will not enable lazy_itable if the kernel apparently does
not support that feature.  This will cause spurious test failures when
the tests are running on such a system (or where sysfs is not
mounted).

So for the purposes of the regression test we need to force the use of
lazy_itable so that the results conform to expected golden output.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebugfs: fix mknod command on some 32-bit platforms due to LFS
Theodore Ts'o [Tue, 26 Jun 2018 13:02:46 +0000 (09:02 -0400)] 
debugfs: fix mknod command on some 32-bit platforms due to LFS

On some platforms the layout of struct stat changes if
_FILE_OFFSET_BITS is set to 64 (which force the use of 64-bit types
and 64-bit variants for system calls such as stat, lseek, etc.)

This is not true (mercifully) on i386, but it is true for the 32-bit
mips platform on Linux.  This caused debugfs's mknod command to fail,
since it used struct stat to pass the desired st_mode and st_rdev
fields for the to-be-created device file or FIFO, and this would be
different for create_inode.c and debugfs.c.

Linking together different object files together compiled with
different values of _FILE_OFFSET_BITS is perilous, but for now, let's
fix the specific problem by passing the two fields in the stat
structure that we really care about.  This fixes two regression tests
on the 32-bit MIPS platform: d_special_files and r_move_itable.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoUpdate release notes, etc., for the 1.44.3-rc1 release v1.44.3-rc1
Theodore Ts'o [Mon, 25 Jun 2018 14:16:38 +0000 (10:16 -0400)] 
Update release notes, etc., for the 1.44.3-rc1 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoUpdate Makefile.in files using "make depend"
Theodore Ts'o [Mon, 25 Jun 2018 14:10:39 +0000 (10:10 -0400)] 
Update Makefile.in files using "make depend"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: update libext2fs.symbol to reflect new hashmap functions
Theodore Ts'o [Mon, 25 Jun 2018 14:04:12 +0000 (10:04 -0400)] 
debian: update libext2fs.symbol to reflect new hashmap functions

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebian: update standards version to 4.1.4
Theodore Ts'o [Mon, 25 Jun 2018 14:03:20 +0000 (10:03 -0400)] 
debian: update standards version to 4.1.4

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: fix up f_detect_junk and f_detect_xfs
Theodore Ts'o [Mon, 25 Jun 2018 13:43:18 +0000 (09:43 -0400)] 
tests: fix up f_detect_junk and f_detect_xfs

The golden output files for these two tests were out of date.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoresize: remove calculation of unused variable
Theodore Ts'o [Mon, 25 Jun 2018 01:27:42 +0000 (21:27 -0400)] 
resize: remove calculation of unused variable

Fix-Coverty-Bug: 1398367
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebugfs: suppress spurious "checksum errors" message for unrelated failures
Theodore Ts'o [Mon, 25 Jun 2018 01:21:49 +0000 (21:21 -0400)] 
debugfs: suppress spurious "checksum errors" message for unrelated failures

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: only retry to open the file system when the superblock is corrupt
Theodore Ts'o [Mon, 25 Jun 2018 01:09:59 +0000 (21:09 -0400)] 
e2fsck: only retry to open the file system when the superblock is corrupt

Previously we were always retrying the ext2fs_open2() call with the
EXT2_FLAG_IGNORE_SB_ERRORS flag.  It only makes sense to do this if
the superblock is reported as corrupt.  Otherwise, it's a waste of
time, and results in printing an extra set of error messages to annoy
the user.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe4crypt: remove unneeded stat(2) call in do_get_policy()
Theodore Ts'o [Sun, 24 Jun 2018 23:28:13 +0000 (19:28 -0400)] 
e4crypt: remove unneeded stat(2) call in do_get_policy()

We don't need to conditionally use O_DIRECTORY when opening a
directory.  Remove the unneeded stat, and a TOCTOU complaint from
Coverity.

Fixes-Coverity-Bug: 1293497
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: fix i_qcow test to properly test e2image's qcow-to-raw functionality
Theodore Ts'o [Sun, 24 Jun 2018 22:30:50 +0000 (18:30 -0400)] 
tests: fix i_qcow test to properly test e2image's qcow-to-raw functionality

The test script was not properly checking e2image's ability to convert
a qcow2 image back to a raw image.  Fix this, and also change it to
use /tmp for the temporary files to speed things up systems with a
ramdisk for /tmp.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2image, libext2fs: check for corrupted qcow2 image
Theodore Ts'o [Sun, 24 Jun 2018 18:52:03 +0000 (14:52 -0400)] 
e2image, libext2fs: check for corrupted qcow2 image

If the qcow2 image is corrupted, qcow2_write_image() will now return
an indication of this to e2image (the only current user of
qcow2_write_image).

Also fix how e2image prints an error message it can't understand the
qcow2 image.

Addresses-Coverity-Bug: 1297511
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibext2fs: explicitly ignore a possible unlink failure in ext2fs_free_icount
Theodore Ts'o [Sun, 24 Jun 2018 18:32:15 +0000 (14:32 -0400)] 
libext2fs: explicitly ignore a possible unlink failure in ext2fs_free_icount

There's not much we can do if the unlink of the tdb file fails, and we
don't want to print a warning message from a library.

Fixes-Coverity-Bug: 1308364
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: add error-checking when unlink tdb file for dir_info
Theodore Ts'o [Sun, 24 Jun 2018 18:00:14 +0000 (14:00 -0400)] 
e2fsck: add error-checking when unlink tdb file for dir_info

Fixes-Coverity-Bug: 1308365
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agomke2fs: add proper error checking in write_reserved_inodes
Theodore Ts'o [Sun, 24 Jun 2018 17:54:58 +0000 (13:54 -0400)] 
mke2fs: add proper error checking in write_reserved_inodes

Fixes-Coverity-Bug: 1369034
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: add proper error checking in move_quota_inode
Theodore Ts'o [Sun, 24 Jun 2018 17:52:10 +0000 (13:52 -0400)] 
e2fsck: add proper error checking in move_quota_inode

Fixes-Coverity-Bug: 1369035
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2image: Add an assertion/sanity check in initialize_qcow2_image()
Theodore Ts'o [Sun, 24 Jun 2018 05:04:48 +0000 (01:04 -0400)] 
e2image: Add an assertion/sanity check in initialize_qcow2_image()

This is mostly to shut up some coverity warnings, but in theory
fs->blocksize could have been corrupted outside of this function...

Fixes-Coverity-Bug: 1297492
Fixes-Coverity-Bug: 1297490
Fixes-Coverity-Bug: 1297488
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agodebugfs: avoid undefined bit shift in parse_uint()
Theodore Ts'o [Sun, 24 Jun 2018 04:39:37 +0000 (00:39 -0400)] 
debugfs: avoid undefined bit shift in parse_uint()

The case is one that should never happen (and indicates a bug if it
does), but in that case, we should still avoid an undefiniced C
expression.

Fixes-Coverity-Bug: 1297494
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2image: calculate progress rate using floating point
Theodore Ts'o [Sun, 24 Jun 2018 04:32:51 +0000 (00:32 -0400)] 
e2image: calculate progress rate using floating point

One of the divisions used when caluclate the progress rate was being
done as an integer instead of floating-point operation.  This could
cause the end result to not be as accurate as we would like.

Fixes-Coverity-Bug: 1297513
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe4crypt: fix invalid errno comparison with a negative error code
Theodore Ts'o [Sun, 24 Jun 2018 04:25:14 +0000 (00:25 -0400)] 
e4crypt: fix invalid errno comparison with a negative error code

Fixes-Coverity-Bug: 1292755
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoAOSP: e2fsdroid: Correctly process the root inode
Luis Hector Chavez [Tue, 19 Jun 2018 21:50:40 +0000 (14:50 -0700)] 
AOSP: e2fsdroid: Correctly process the root inode

This change ensures that the root inode has the correct uid/gid by
calling androidify_inode() on it. It also sets android_configure = 1
when the u/gid mapping is provided.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Google-Bug-Id: 78561186
Google-Bug-Id: 110415537
Test: $ m  # With BOARD_SYSTEMIMAGE_UID_MAP=655360 0 5000
      $ simg2img ${OUT}/{system.img,system.raw.img}
      $ mkdir tmp
      $ sudo mount -o loop ${OUT}/system.raw.img tmp
      $ stat --format="%u %g" tmp
      655360 655360
Change-Id: I842a32b6d64439f9f16b9c6b66de20d4e4418aa8
From AOSP commit: ee3f0f37c34d68aa7a96a36dea369acae312772c

5 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Sun, 24 Jun 2018 03:14:14 +0000 (23:14 -0400)] 
po: update nl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoFix gcc and clang warnings
Theodore Ts'o [Sun, 24 Jun 2018 03:00:50 +0000 (23:00 -0400)] 
Fix gcc and clang warnings

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibext2fs: remove c99 idiom to fix build
Eric Sandeen [Sat, 23 Jun 2018 22:04:19 +0000 (18:04 -0400)] 
libext2fs: remove c99 idiom to fix build

hashmap.c: In function ‘ext2fs_hashmap_free’:
hashmap.c:72:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (size_t i = 0; i < h->size; ++i) {
  ^
hashmap.c:72:2: note: use option -std=c99 or -std=gnu99 to compile your code
make[2]: *** [hashmap.o] Error 1

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: fix f_bigalloc_orphan_list so it is not dependant on umask
Theodore Ts'o [Sat, 23 Jun 2018 21:54:28 +0000 (17:54 -0400)] 
tests: fix f_bigalloc_orphan_list so it is not dependant on umask

Reported-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: mark device inodes with EXT4_EXTENTS_FL bad
Andreas Dilger [Sat, 23 Jun 2018 21:33:58 +0000 (17:33 -0400)] 
e2fsck: mark device inodes with EXT4_EXTENTS_FL bad

Mark device inodes bad if they have the EXT4_EXTENTS_FL set, since
this should never happen and likely shows the inode is corrupt.

Change-Id: I85ab667b39ff57c658a779e59f692a080217690e
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: PAGE_SIZE larger than blocksize with hole
Andreas Dilger [Sat, 23 Jun 2018 20:26:41 +0000 (16:26 -0400)] 
tests: PAGE_SIZE larger than blocksize with hole

Verify correct operation in the case of writing files with allocated
blocks at the end of the file beyond i_size.  This can happen for
PAGE_SIZE > blocksize, or through fallocate().

The f_eofblocks thest checks quite the same situation, but for broken
file system. This test is about correct file.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: handle preallocation for large PAGE_SIZE
Andreas Dilger [Sat, 23 Jun 2018 18:30:52 +0000 (14:30 -0400)] 
e2fsck: handle preallocation for large PAGE_SIZE

Fix handling of block preallocation support in cases where the kernel
PAGE_SIZE is larger than the filesystem blocksize.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibcom_err: handle error case when FD_CLOEXEC can't be set on debug FILE
Theodore Ts'o [Sat, 23 Jun 2018 03:21:34 +0000 (23:21 -0400)] 
libcom_err: handle error case when FD_CLOEXEC can't be set on debug FILE

Fixes-Coverity-Bug: 1049142
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibext2fs: simplify extent_fallocate()
Theodore Ts'o [Sat, 23 Jun 2018 03:05:49 +0000 (23:05 -0400)] 
libext2fs: simplify extent_fallocate()

The goal_distance variable is used in only one place in the
extent_fallocate() function, so set it right before it is used, and
eliminate one assignment of goal_distance which is never used before
it gets overwritten.

Fixes-Coverity-Bug: 1307694
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibsupport: fix (very potential) NULL dereference
Theodore Ts'o [Sat, 23 Jun 2018 02:53:00 +0000 (22:53 -0400)] 
libsupport: fix (very potential) NULL dereference

It's a very rare set of circumstances (requiring deleting profile
sections, which e2fsprogs doesn't do) that might trigger a NULL
derference, but fix it for robustness's sake, maybe some day someone
will use that functionality.

Fixes-Coverity-Bug: 207508
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibext2fs: fix uninitialized variable dereference in extent_bmap()
Theodore Ts'o [Sat, 23 Jun 2018 02:33:39 +0000 (22:33 -0400)] 
libext2fs: fix uninitialized variable dereference in extent_bmap()

The code path was failing to initialize the logial block number hint
in the allocation context.  It's not currently being used, but it
might be in the future, and it trips warnings in static code
analyzers.

Fixes-Coverity-Bug: 709545
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibsupport: fix memory leak in error path in quota_compute_usage()
Theodore Ts'o [Sat, 23 Jun 2018 02:20:51 +0000 (22:20 -0400)] 
libsupport: fix memory leak in error path in quota_compute_usage()

Fixes-Coverity-Bug: 1362023
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibext2fs: fix potential resource leak in ext2fs_file_write
Theodore Ts'o [Sat, 23 Jun 2018 01:57:40 +0000 (21:57 -0400)] 
libext2fs: fix potential resource leak in ext2fs_file_write

If EXT2_FLAG_SHARE_DUP is set, and ext2fs_bmap2() fails, it's possible
that we will leak the allocated memory in new_block.

Fixes-Coverity-Bug: 1437473
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agomisc: add e2mmpstatus utility via dumpe2fs
Shuichi Ihara [Wed, 2 May 2018 04:26:06 +0000 (22:26 -0600)] 
misc: add e2mmpstatus utility via dumpe2fs

e2mmpstatus is a Multi-Mount Protection (MMP) helper utility to read
an MMP block to see if it is being updated.  It can also output the
latest update time, nodename, and device from the MMP block.

This is useful for HA and other maintenance scripts to determine if
the filesystem is in use on another node, and which node it is.

Signed-off-by: Shuichi Ihara <sihara@ddn.com>
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Moved e2mmpstatus checking/dumping code to be part of dumpe2fs rather
than a standalone program, using the "-m" option to check MMP status,
and "-i" to dump info.  If dumpe2fs is called as "e2mmpstatus" (and
also "mmpstatus" for compatibility reasons), assume "-m" is specified.

Re-use the existing MMP block handing routines (with some changes) to
check and dump the MMP block, rather than adding duplicate versions.

Modify dumpe2fs to exit with a non-zero error code if there is an
error while reading the filesystem metadata or MMP block, or if
"-m" is used with the "mmp" feature and is in use by another node.

Add a configure check for gethostname() rather than depending on
_BSD_SOURCE or _XOPEN_SOURCE to be set.

Update the f_mmp, m_mmp, m_mmp_bad_csum, and m_mmp_bad_magic tests
to use e2mmpstatus to check and dump the MMP state before and after
e2fsck is run to verify that the tool is working correctly.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoe2fsck: set dir_nlink feature if large dir exists
Andreas Dilger [Fri, 22 Jun 2018 22:08:54 +0000 (18:08 -0400)] 
e2fsck: set dir_nlink feature if large dir exists

If there is a directory with more than EXT2_LINK_MAX (65000)
subdirectories, but the DIR_NLINK feature is not set in the
superblock, the feature should be set before continuing on
to change the on-disk directory link count to 1.

While most filesystems should have DIR_NLINK set (it was set
by default for all ext4 filesystems, and all kernels between
2.6.23 and 4.12 automatically set it if the directory link
count grew too large), it is possible that this flag is lost
due to disk corruption or for an upgraded filesystem.  We no
longer want kernels to automatically enable features.

Addresses: https://bugzilla.kernel.org/show_bug.cgi?id=196405
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: remove pre-generated f_extent_htree image
Andreas Dilger [Fri, 22 Jun 2018 21:54:50 +0000 (17:54 -0400)] 
tests: remove pre-generated f_extent_htree image

The f_extent_htree test depends on the "mke2fs -d" functionality
that did not exist in the maint branch when the patch was landed.
On master this functionality exists and should be used instead of
a pre-generated image.  That exercises the "mke2fs -d" functionality
as well as e2fsck better.

[ Fixed to add missing expect.pre.? files --tytso ]

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: don't run sed multiple times on test output
Andreas Dilger [Wed, 2 May 2018 04:26:03 +0000 (22:26 -0600)] 
tests: don't run sed multiple times on test output

Don't call sed multiple times on the output, and avoid the use
of temporary files, or if possible.  It would be convenient to
use "sed -i" to only update the output file once, but this is
not portable to all platforms.

[ Fixed a few test regression failures --tytso ]

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: remove redundant sed filtering
Andreas Dilger [Wed, 2 May 2018 04:26:02 +0000 (22:26 -0600)] 
tests: remove redundant sed filtering

Now that the majority of device name filtering is in filter.sed,
it does not need to be specified explicitly for every test.

Fix the error message printed in debugfs when opening the device
to match that used in other tools.  This simplifies the filtering,
and will be helpful if debugfs messages are internationalized.

[ Fixed up some test failures in m_hugefile t_uninit_bg_rm --tytso ]

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoext2fs: annotate superblock/inode offsets
Andreas Dilger [Fri, 22 Jun 2018 16:37:12 +0000 (12:37 -0400)] 
ext2fs: annotate superblock/inode offsets

Add byte offsets for the fields in ext2_super_block and ext2_inode
for convenience when debugging on-disk structures.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: clean up $DEBUGFS_EXE usage in scripts
Andreas Dilger [Fri, 22 Jun 2018 15:43:54 +0000 (11:43 -0400)] 
tests: clean up $DEBUGFS_EXE usage in scripts

Instead of putting the entire test script under an implicit
"if test -x $DEBUGFS_EXE" conditional (sometimes indenting
the code, and sometimes not), rather check for the reverse
and exit the test script early if $DEBUGFS_EXE is missing.

In some places, tests were running $DEBUGFS_EXE directly,
when they should be running $DEBUGFS (which will run with
Fortify, or other options).

[ Fixed up missing exit statement in f_detect_junk. --tytso ]

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: don't unlink test image if SKIP_UNLINK set
Andreas Dilger [Fri, 22 Jun 2018 15:42:41 +0000 (11:42 -0400)] 
tests: don't unlink test image if SKIP_UNLINK set

Don't register a trap to unlink $TMPFILE at the test exit if
SKIP_UNLINK is set.  Otherwise, this makes it difficult to
debug a failing test.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agotests: don't use a sparse test file
Andreas Dilger [Fri, 22 Jun 2018 15:42:14 +0000 (11:42 -0400)] 
tests: don't use a sparse test file

If the TEST_BITS file is sparse, then the "debugfs -R write"
command may skip holes in the file when copying it into the
test image (depending on whether SEEK_HOLE/SEEK_DATA and/or
FIEMAP are available in the copy_file() function).

This was causing test failures on MacOS in the f_dup_resize
and d_loaddump tests because the TEST_BITS file was the
compiled "debugfs" binary, which apparently has holes when
built on MacOS, and the number of blocks allocated in the
test image was reduced as a result.  This caused the expect
output to differ in the summary line and resulted in failure.

Instead of using the debugfs binary for TEST_BITS, generate
a temporary file using /dev/urandom, if available.  If not,
fall back to the old behaviour or using debugfs.

[ Fixed up use of non-POSIX /bin/sh constructs and add test_data.tmp to
  .gitignore and files to be deleted on a make clean. --tytso ]

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agolibext2fs: don't corrupt an blkmap64_rb when marking a range of size zero
Theodore Ts'o [Fri, 22 Jun 2018 14:46:52 +0000 (10:46 -0400)] 
libext2fs: don't corrupt an blkmap64_rb when marking a range of size zero

Calling ext2fs_mark_block_bitmap_range2() with a count of zero can end
up corrupting the red-black block bitmap structure, since a an entry
in the rbtree with zero-length extent can end up causing the
find_first_{zero,set} operations to return incorrect results.

This was found by Adam Buchbinder, who created a fuzzed file system
using which AFL that caused e2fsck to hang in an infinite loop in in
e2fsck's readahead code.

Added a regression test to detect this failure.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agofilefrag: don't ignore fsync errors
Lukas Czerner [Thu, 21 Jun 2018 13:19:56 +0000 (15:19 +0200)] 
filefrag: don't ignore fsync errors

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 years agoAOSP: Mark as recovery_available:true
Jiyong Park [Thu, 24 May 2018 05:07:52 +0000 (14:07 +0900)] 
AOSP: Mark as recovery_available:true

Libraries that are direct or indirect dependencies of modules installed
to recovery partition (e.g. adbd) are marked as recovery_available:
true. This allows a recovery variant of the lib is created when it is
depended by other recovery or recovery_available modules.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Google-Bug-Id: 79146551
Test: m -j
Change-Id: I9db889c15e1f563a1e3f4e7dc5b630d19e3cf4c0
From AOSP commit: 4a9d5f4211818c70a1b2414e3774197386b7f245