]> git.ipfire.org Git - thirdparty/e2fsprogs.git/log
thirdparty/e2fsprogs.git
6 years agoMerge branch 'maint' into next
Theodore Ts'o [Wed, 5 Jul 2017 03:53:11 +0000 (23:53 -0400)] 
Merge branch 'maint' into next

6 years agolibext2fs: fix compile errors/warnings
Tahsin Erdogan [Fri, 30 Jun 2017 04:19:32 +0000 (21:19 -0700)] 
libext2fs: fix compile errors/warnings

Defining DEBUG_QUOTA reveals a few compile errors. Fix these.
Also fix format string type mismatches in a couple of log_debug()
calls.

Fixes: 2d2d799c7261 ("Clean up codes for adding new quota type")
Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoFix warnings found using UBSAN
Theodore Ts'o [Tue, 4 Jul 2017 22:00:46 +0000 (18:00 -0400)] 
Fix warnings found using UBSAN

Compiling with -fsanitize=undefined -fsanitize=address causes some
warnings of C code that has undefined behavior according to the C
standard bugs.  None of the warnings should cause e2fsprogs
malfunction given a sane compiler running on architectures that Linux
can support.  Still, it's better to clean up to code than not.

To fix up a complaint of a negative shift in hash function, update the
very dated hash we had been using for the revoke table with the
current generic hash used by the kernel.

Other fixes are fairly self-explanatory.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotests: add j_recover_csum3_64bit
Theodore Ts'o [Tue, 4 Jul 2017 21:51:48 +0000 (17:51 -0400)] 
tests: add j_recover_csum3_64bit

Add a test to make sure we are correctly recovering 64-bit journals
using the v3 checksum format.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: fix build issue for on Windows/Cygwin systems
Theodore Ts'o [Tue, 4 Jul 2017 01:28:53 +0000 (21:28 -0400)] 
libext2fs: fix build issue for on Windows/Cygwin systems

Provide ext2fs_get_device_size2() for Windows/Cygwin systems, so
builds can succeed.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoe4defrag: fix GCC7.x compiler warning
Marc Thomas [Mon, 26 Jun 2017 15:40:39 +0000 (16:40 +0100)] 
e4defrag: fix GCC7.x compiler warning

../../misc/e4defrag.c:1821:8: warning: statement will never be executed
[-Wswitch-unreachable]
    int mount_dir_len = 0;

Also fix a typo in a few comments.

Signed-off-by: Marc Thomas <marc@dragonfly.plus.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agofilefrag: fix GCC7.x compiler warning
Marc Thomas [Mon, 26 Jun 2017 15:39:47 +0000 (16:39 +0100)] 
filefrag: fix GCC7.x compiler warning

../../misc/filefrag.c:591:33: warning: comparison between pointer and
zero character constant [-Wpointer-compare]
  for (cpp = argv + optind; *cpp != '\0'; cpp++) {

Signed-off-by: Marc Thomas <marc@dragonfly.plus.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoMerge branch 'maint' into next
Theodore Ts'o [Fri, 23 Jun 2017 22:26:31 +0000 (18:26 -0400)] 
Merge branch 'maint' into next

6 years agoe4defrag: display the e2fsprogs version number
Marc Thomas [Fri, 9 Jun 2017 12:58:32 +0000 (13:58 +0100)] 
e4defrag: display the e2fsprogs version number

Signed-off-by: Marc Thomas <marc@dragonfly.plus.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotests: add new test f_del_dup_quota
Eric Whitney [Fri, 23 Jun 2017 21:28:12 +0000 (17:28 -0400)] 
tests: add new test f_del_dup_quota

Add a test to validate the changes in commit b0f5fa880c36: "e2fsck:
fix multiply-claimed block quota accounting when deleting files".

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agomke2fs: fix hugefile creation so the hugefile(s) are contiguous
Theodore Ts'o [Mon, 19 Jun 2017 22:39:55 +0000 (18:39 -0400)] 
mke2fs: fix hugefile creation so the hugefile(s) are contiguous

Commit 4f868703f6f2: "libext2fs: use fallocate for creating journals
and hugefiles" introduced a regression for the mke2fs hugefile
feature.  The problem is that the fallocate library function
intersperses the extent tree metadata blocks with the data blocks, and
this violates the hugefile guarantee that the created files should be
physically contiguous on disk.

Unfortuantely the m_hugefile regression test was flawed, and didn't
pick up the regression.

This commit fixes the regression test so that it detects the problem
before fixing mke2fs, and also fixes the mke2fs hugefile by reverting
the mke2fs hugefile portion of commit 4f868703f6f2.

Google-Bug-Id: 62791459

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: fix fsync(2) detection
Jan Kara [Wed, 7 Jun 2017 13:31:14 +0000 (15:31 +0200)] 
libext2fs: fix fsync(2) detection

For some reason lib/config.h.in was missing a definition of HAVE_FSYNC
and as a result lib/config.h never had HAVE_FSYNC defined. As a result
we never called fsync(2) for example from
lib/ext2fs/unix_io.c:unix_flush() when we finished creating filesystem
and could miss IO errors happening during creating of the filesystem.
Test generic/405 exposes this problem.

Fix the problem by defining HAVE_FSYNC in lib/config.h.in.

Fixes: f47f31958578
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: fix build warning on Big Endian systems in closefs.c
Theodore Ts'o [Sun, 4 Jun 2017 23:28:35 +0000 (19:28 -0400)] 
libext2fs: fix build warning on Big Endian systems in closefs.c

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: correctly write up the backup superblocks in big endian systems
Theodore Ts'o [Sun, 4 Jun 2017 22:37:31 +0000 (18:37 -0400)] 
libext2fs: correctly write up the backup superblocks in big endian systems

This bug has been around since we added support for metadata
checksums, but it was unmasked by commit bf9f3b6d5b ("e2fsck: exit
with exit status 0 if no errors were fixed").  The backup superblocks
are not supposed to have the EXT2_VALID_FS or the NEEDS_RECOVERY bits
set, and earlier 1.43.x versions of e2fsprogs were byte swapping the
shadow superblock each time it was written, so that every other backup
superblock was incorrectly byte swapped.

Fortunately the primary backup superblock was correctly written
(modulo having the VALID_FS bit set when it should not have been set)
so for the most part no one noticed.  And very few architectures use
big endian byte ordering these days.  (Even IBM has seen the light
with the ppcle architecture.  :-)

Fortunately commit bf9f3b6d5b caused f_desc_size_bad and
f_resize_inode to fail on a big endian system, which allowed me to
notice the issue and investigate.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2freefrag: use GETFSMAP on mounted filesystems
Darrick J. Wong [Mon, 15 May 2017 18:37:11 +0000 (11:37 -0700)] 
e2freefrag: use GETFSMAP on mounted filesystems

Use GETFSMAP to query mounted filesystems for free space information.
This prevents us from reporting stale free space stats if there happen
to be uncheckpointed block bitmap updates sitting in the journal.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoMerge branch 'maint' into next
Theodore Ts'o [Tue, 30 May 2017 00:43:01 +0000 (20:43 -0400)] 
Merge branch 'maint' into next

7 years agotune2fs: fix BUGs of tuning project quota
Wang shilong [Tue, 30 May 2017 00:36:51 +0000 (20:36 -0400)] 
tune2fs: fix BUGs of tuning project quota

There are several problems for project quota enable/disable:
tune2fs -O ^project did not work, because @clear_ok_features
did not include @EXT4_FEATURE_RO_COMPAT_PROJECT.

update_feature_set() works for -O option, but tune2fs -Q prj/^prj
did not work well, because function handle_quota_options()
did not set and clear @EXT4_FEATURE_RO_COMPAT_PROJECT feature very well.

one warning message is removed, because with project feature
enabled, quota feature will be enabled automatically.

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agobadblocks: support languages which use multi-column wide characters
Theodore Ts'o [Tue, 30 May 2017 00:04:56 +0000 (20:04 -0400)] 
badblocks: support languages which use multi-column wide characters

CJK characters take up two columns for each character; teach badblocks
to take this into account.

Addresses-Debian-Bug: #860926

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reported-by: "Mingye Wang (Arthur2e5)" <arthur200126@gmail.com>
7 years agoe2fsck: don't flush to device opened in read-only mode
Konstantin Chistyakov [Mon, 29 May 2017 23:11:38 +0000 (19:11 -0400)] 
e2fsck: don't flush to device opened in read-only mode

If the e2fsck is called with both the -f and -n options, it will
complete with an exit status of 8 due to an error when trying to flush
the io_channel (which was opened read-only) when built on on Cygwin on
Windows 8.1 and Windows 10.  Apparently Cygwin is unhappy when fsync
is called on a file descriptor opened read-only.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsprogs: Make -U option consistent between tune2fs and mke2fs
Drew Davenport [Mon, 29 May 2017 22:51:21 +0000 (18:51 -0400)] 
e2fsprogs: Make -U option consistent between tune2fs and mke2fs

Allow "null", "clear", "random", or "time" for the -U option for
mke2fs, which are already allowed options for tune2fs.

Signed-off-by: Drew Davenport <ddavenport@google.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoMerge branch 'maint' into next
Theodore Ts'o [Thu, 25 May 2017 17:55:23 +0000 (13:55 -0400)] 
Merge branch 'maint' into next

7 years agotests: fix expected output for f_detect_junk
Theodore Ts'o [Thu, 25 May 2017 17:11:40 +0000 (13:11 -0400)] 
tests: fix expected output for f_detect_junk

The expect files for f_detect_junk had gotten out of sync with the
code base, and since this test is optional (it depends on libmagic
being installed), we hadn't noticed.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoMerge branch 'maint' into next
Theodore Ts'o [Thu, 25 May 2017 02:13:26 +0000 (22:13 -0400)] 
Merge branch 'maint' into next

7 years agoe2fsck: fix sparse bmap to extent conversion
Darrick J. Wong [Thu, 25 May 2017 01:56:36 +0000 (21:56 -0400)] 
e2fsck: fix sparse bmap to extent conversion

When e2fsck is trying to convert a sparse block-mapped file to an extent
file, we incorrectly merge block mappings that are physically contiguous
but not logically contiguous because of insufficient checking with the
extent we're constructing.  Therefore, compare the logical offsets for
contiguity as well.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolibext2fs: correctly subtract xattr blocks on bigalloc filesystems
Eric Biggers [Thu, 25 May 2017 01:48:41 +0000 (21:48 -0400)] 
libext2fs: correctly subtract xattr blocks on bigalloc filesystems

ext2fs_inode_data_blocks2() calculates an inode's data block count by
subtracting the external xattr block, if any, from the total blocks.
But on bigalloc filesystems, the xattr "block" is actually a whole
cluster, so ext2fs_inode_data_blocks2() would return a too-large value.

It seems this could have caused several different problems, but the one
I encountered was that xfstest generic/399 failed in the "bigalloc"
config because e2fsck incorrectly considered a symlink on the filesystem
to be corrupted at the end of the test.  This happened because e2fsck
incorrectly calculated a nonzero data block count for a "fast" symlink
with an external xattr block and therefore treated it as a "slow"
symlink, which failed validation.

Fix this by updating ext2fs_inode_data_blocks2() to subtract the cluster
size rather than the block size.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: fix multiply-claimed block quota accounting when deleting files
Eric Whitney [Thu, 25 May 2017 01:34:20 +0000 (21:34 -0400)] 
e2fsck: fix multiply-claimed block quota accounting when deleting files

As e2fsck processes each file in pass1, the actual file system quota is
increased by the number of blocks discovered in the file.  This can
include both non-multiply-claimed and multiply-claimed blocks, if the
latter exist.  However, if a file containing multiply-claimed blocks
is then deleted in pass1b, those blocks are not taken into account when
decreasing the actual quota.  In this case, the new quota values written
to the file system by e2fsck overstate the space actually consumed.
And, e2fsck must be run twice on the file system to fully correct
quota.

Fix this by counting multiply-claimed blocks as a debit to quota when
deleting files in pass1b.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
7 years agoAOSP: Define HAVE_SYS_SYSMACROS_H for Android.
Elliott Hughes [Fri, 19 May 2017 19:49:54 +0000 (12:49 -0700)] 
AOSP: Define HAVE_SYS_SYSMACROS_H for Android.

Also remove a duplicate copy of misc/create_inode.c that isn't upstream.

Bug: https://github.com/android-ndk/ndk/issues/398
Test: builds
Change-Id: Ibc475c82aa21f063673cb68bcf6e41ad9d821cd3
From AOSP commit: 37f805a9571cf33c95080c3dbd65c7a4e46fcd71

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoconfigure: Update configure script after integrated AOSP commits
Theodore Ts'o [Wed, 24 May 2017 03:08:47 +0000 (23:08 -0400)] 
configure: Update configure script after integrated AOSP commits

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: e2fsdroid: skip setting timestamp if src_dir is null
Jin Qian [Tue, 2 May 2017 20:20:27 +0000 (13:20 -0700)] 
AOSP: e2fsdroid: skip setting timestamp if src_dir is null

fs_mgr formats /data without src_dir.

Test: zero-out first 4096 bytes on /data partition and reboot
Bug: 35219933
Change-Id: I12f1eb1002fd96d18fc7a9ae5a529f673eb57273
From AOSP commit: b5330546f444b49c4d751e9ddd7677ae97161f0c

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: e2fsdroid: support multiple selinux file contexts
Jin Qian [Fri, 21 Apr 2017 23:29:07 +0000 (16:29 -0700)] 
AOSP: e2fsdroid: support multiple selinux file contexts

Support passing a string of multiple selinux file contexts separated by
comma with -S option.

E.g. e2fsdroid -S ctx1,ctx2 output

Test: make systemimage
Bug: 35219933
Change-Id: Icc0f9d5d6180b5db7d68f7de45a1128f5a20be89
From AOSP commit: 34f4f33b24280c0a21a95407da4cf4988b275c95

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolibblkid: fix buffer overflow scanning partition name
Jin Qian [Mon, 17 Apr 2017 23:13:20 +0000 (16:13 -0700)] 
libblkid: fix buffer overflow scanning partition name

If "line" is carefully crafted, sscanf will write 1 byte over ptname.

Bug: 36103037
Change-Id: Ia19e032d7c65edc27373ebccc0a5569f0fa31161
From AOSP commit: 085e63d064620c763a62406a5ff4299bcee1838e

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: e2fsdroid: don't print empty files in block_list.c:end_new_file
Ben Fennema [Thu, 9 Mar 2017 06:44:17 +0000 (22:44 -0800)] 
AOSP: e2fsdroid: don't print empty files in block_list.c:end_new_file

Change-Id: I4b38841c9c36a8faaa9f65bc7b61c7abdddab094
Signed-off-by: Ben Fennema <fennema@google.com>
From AOSP commit: cc933ab3bfee821dc885fe5a6bbb2a4997304ff9

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: Disable macro redefined warnings.
Christopher Ferris [Thu, 23 Feb 2017 23:36:54 +0000 (15:36 -0800)] 
AOSP: Disable macro redefined warnings.

The new kernel headers do:

  #define __bitwise __bitwise__

However, the code redefines __bitwise without undef'ing it first.

This is a temporary fix, b/35721782 filed to fix this.

Change-Id: I2c6a64146966f1737835f012d24ccc844570d02b
Test: Builds without warningers/errors.
From AOSP commit: commit 91581e8f15b8a29aedea3e7c11162301c7e66ec3

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: Add "libc" to soong static_executable targets.
Alex Deymo [Thu, 26 Jan 2017 01:47:50 +0000 (17:47 -0800)] 
AOSP: Add "libc" to soong static_executable targets.

When building a static exectuable for "arm", the libgcc is automatically
included by the build system *after* libc, but libgcc has some symbol
dependencies on "libc", like for example the "raise" symbol.

libgcc, libatomic and libcompiler_rt-extras are passed in a group
(enclosed by --start-group and --end-group) so they all are included
regardless of the order inside that group. Nevertheless libc only
appears outside this group and before them, so the undefined references
from libgcc are not resolved.

This patch adds "libc" as a explicit static_libs dependency to
static_executable targets forcing it to be included in the group.

Bug: 34220783
Test: mmma external/e2fsprogs
Change-Id: Ia18db10da0f18494600d7e0c870291902d71b287
From AOSP commit: b799ad178fa18c2925a283206496d3f5d6e87f35

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: Convert e2fsprogs targets to soong.
Alex Deymo [Thu, 12 Jan 2017 17:48:04 +0000 (09:48 -0800)] 
AOSP: Convert e2fsprogs targets to soong.

This patch also removes all the "-host" and "_static" suffix from all
the libraries adding "unique_host_soname: true". This prevents
confusions with the host installed libraries.

A new "libext2_misc" library is introduced to export some files from
the misc/ directory to other binaries in this project.

Bug: 34220783
Test: mmma external/e2fsprogs

Change-Id: Ia1b689991346b11f8cb38f7c6ee356e666e01d6d
From AOSP commit: 7a9e1a96766d31a41b88f0a539fcc3d532b5c530

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: HACK: android: exit(1) if selabel_lookup fails
Nick Kralevich [Wed, 18 Jan 2017 23:17:42 +0000 (15:17 -0800)] 
AOSP: HACK: android: exit(1) if selabel_lookup fails

If selabel_lookup fails, the current implementation of set_selinux_xattr
returns -1, but the command line tool e2fsdroid reports success.
There's a bunch of things wrong:

1) -1 does not appear to be a legal errcode_t value. The appropriate
return value appears to be DIRENT_ABORT.
2) A return value of DIRENT_ABORT is ignored by the upper layers of the
code.
3) Attempting to fix the upper layers of the code to not ignore
DIRENT_ABORT results in complaints about not being able to create
/lost+found.

Call stack:

- main
 - android_configure_fs
  - __android_configure_fs
   - ext2fs_dir_iterate2
    - ext2fs_block_iterate3
     - ext2fs_process_dir_block
      - walk_dir
       - ext2fs_dir_iterate2
        - ext2fs_block_iterate3
         - ext2fs_process_dir_block
          - walk_dir
           - ext2fs_dir_iterate2
            - ext2fs_block_iterate3
             - ext2fs_process_dir_block
              - androidify_inode
               - set_selinux_xattr

I'm honestly not sure how to fix this, so just throw an exit(1) in
there, to make sure the program dies a horrible death if
selabel_lookup() fails. This is much better than the alternative of
e2fsdroid returning success with an improperly labeled file.

Bug: 34358308
Test: Artifically modify selabel_lookup() to return a failure, and
      verify Android doesn't compile.
Test: Verify Android compiles under normal circumstances.
Change-Id: I60e04bc6559a66d3f3202f2c28e2519856385ded
From AOSP commit: 87a7db7cf2ca0feecaccad94bf22f92c726000c3

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: Remove "_host" and "_static" suffix from libsparse.
Alex Deymo [Wed, 11 Jan 2017 22:40:43 +0000 (14:40 -0800)] 
AOSP: Remove "_host" and "_static" suffix from libsparse.

Bug: 34220783
Change-Id: I218ab40f423bf0bddebc3b2e1526bd9e3549eed6
From AOSP commit: 92d281bd3145e149d7330272b1704d77191482c4

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: libext2fs: fix sparse param parsing on mac build
Jin Qian [Sat, 7 Jan 2017 00:30:34 +0000 (16:30 -0800)] 
AOSP: libext2fs: fix sparse param parsing on mac build

Flag m is not supported on macos sscanf. Fall back to manually
allocate the string.

Use strict format to skip ":" between params.

Change-Id: Ic4f3747708423d0504ea40fb5cb116068f4a7ab8
From AOSP commit: 901472babf4ea5e4d2d44aa16834b1c899c8937f

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: e2fsdroid: report error from ext2fs
Jin Qian [Mon, 19 Dec 2016 21:23:47 +0000 (13:23 -0800)] 
AOSP: e2fsdroid: report error from ext2fs

Returns error back to caller (build system) instead of failing silently.

Change-Id: I8bad9eed6fe639014126c98c6bf02e539f086a98
From AOSP commit: 948b9fecf8f92785a171c9416080e0660f089deb

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: e2fsdroid: set timestamp based on source files
Jin Qian [Mon, 19 Dec 2016 21:19:58 +0000 (13:19 -0800)] 
AOSP: e2fsdroid: set timestamp based on source files

Timestamp was incorrectly set to -1 or left unset. Use lstat to read
timestamps from source files and set on target files.

Change-Id: I66b2c5281ae769a52bc4e1638895eb5285c18b7a
From AOSP commit: d882f1e23195d1fb16a6fe1887c842d04ab420b7

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: e2fsdroid: use absolute path for product_out
Jin Qian [Mon, 19 Dec 2016 19:02:15 +0000 (11:02 -0800)] 
AOSP: e2fsdroid: use absolute path for product_out

Android build runs e2fsdroid in a tmp directory. Use absolute path
to access files in product_out.

Change-Id: Ic238d93ff68f03bd82245bda127d269972f5ef63
From AOSP commit: bc02ac42b26836f22579a81edb5711cae837732f

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: libext2fs: merge contiguous data blocks when writing to sparse file
Jin Qian [Mon, 19 Dec 2016 18:53:20 +0000 (10:53 -0800)] 
AOSP: libext2fs: merge contiguous data blocks when writing to sparse file

Sparse IO manager allocates one block at a time. This creates many
blocks in sparse file even though most of them are contiguous. As a
result, fastboot is extremely slow writing that many blocks. Merging
contiguous blocks reduces block count and flash time significantly.

Change-Id: I211312d24d7423c7f160ee501fe8b62ddf14a847
From AOSP commit: 6ef6efab23203e967625160e6af4140954e15e91

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: e2fsdroid: remove extra "/" when mountpoint is "/"
Jin Qian [Thu, 15 Dec 2016 20:15:28 +0000 (12:15 -0800)] 
AOSP: e2fsdroid: remove extra "/" when mountpoint is "/"

Extra "/" causes problem when matching entries in fs_config.

Change-Id: Ie1659b98db3d599cdd1a832d2dfb3036d399a6e3
From AOSP commit: 7fe49140ef755e98607a67199971c01ed6a96930

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: android: libext2fs and com_err for windows
Adrien Schildknecht [Wed, 23 Nov 2016 18:21:42 +0000 (10:21 -0800)] 
AOSP: android: libext2fs and com_err for windows

Test: m libext2fs-host && m libext2_com_err-host

Change-Id: I92b6717b617a4f7f16182bf12af58cb22f20fa8f
From AOSP commit: 1538eb4c580d53657f82e4e0170ca5ad5b67455c

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoFix windows and mac build
Jin Qian [Tue, 6 Dec 2016 01:49:41 +0000 (17:49 -0800)] 
Fix windows and mac build

malloc.h is not available on mac.
mntent.h and setmntent are not available on windows.

Test: cd external/e2fsprogs && mm

Change-Id: I3bc1b80156d3659f4d81975626a71f58d39ee61a
(cherry picked from commit 8ca6180b52349968daf601bd89e15491eb2f271f)

7 years agoAOSP: _GNU_SOURCE must be defined before any #include.
Elliott Hughes [Mon, 5 Dec 2016 21:33:29 +0000 (13:33 -0800)] 
AOSP: _GNU_SOURCE must be defined before any #include.

Fixes the "asprintf undeclared" warning in this code.

Bug: N/A
Test: builds
Change-Id: I42e1bfbdbc0391c5e5d7908204f9064ec858c84d
From AOSP commit: 1ebca4b43115846af705bd320bccb8f930e328c8

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: Fix "Can't use getmntent or getmntinfo to check for mounted filesystems!" warning.
Elliott Hughes [Mon, 5 Dec 2016 21:29:49 +0000 (13:29 -0800)] 
AOSP: Fix "Can't use getmntent or getmntinfo to check for mounted filesystems!" warning.

We do have <mntent.h> and setmntent(3).

Also silence unused parameter warnings; C programmers don't care, so
upstream is unlikely to fix that.

Bug: N/A
Test: builds
Change-Id: I57db0cca68a617913e21c2ef7b6613cd1183d7c5
From AOSP commit: d5947f70714e6676bca2663af210bfb9f6118e83

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: android: add the ext2simg tool
Adrien Schildknecht [Thu, 1 Dec 2016 23:05:06 +0000 (15:05 -0800)] 
AOSP: android: add the ext2simg tool

This tool converts ext images to android sparse images.

Test: ext2simg img.ext4 img.sparse
      simg2img img.sparse img2.ext4
      e2fsck -f img.ext; e2fsck -f img2.ext
      cmp img{,2}.ext

Change-Id: I7ec6f126160dacafb0946ba99f07d4bb42a19c45
From AOSP commit: c1b7d19958dc3dbe53810811ea3dcc4f04f85c73

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: android: add rules to build the static host libraries
Adrien Schildknecht [Wed, 23 Nov 2016 08:46:47 +0000 (00:46 -0800)] 
AOSP: android: add rules to build the static host libraries

Test: m libext2fs-host

Change-Id: I0f8155bc37516a59cf0ae1545ba37d52025f7a36
From AOSP commit: ef511144c0104bcf2c730888bb39e1c4f95680d2

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: e2fsdroid: create incremental images
Adrien Schildknecht [Wed, 30 Nov 2016 06:15:18 +0000 (22:15 -0800)] 
AOSP: e2fsdroid: create incremental images

Add an option to read a base_fs file and allocate the blocks according
to the mapping provided by the file.

Test: 1/ Create a normal image and an incremental one.
         Compare the number of blocks that have changed.
      2/ Create an image.
         Create an incremantal image.
         The basefs file and the block_list file are the same.

Change-Id: Ie000ca48cf000d95e7a45a9752699abfc7484b6c
From AOSP commit: 16babe7b79c4c9b6d75d60e30c04a8e24278e4fa

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: e2fsdroid: read and enforce android's permissions
Adrien Schildknecht [Wed, 30 Nov 2016 06:01:52 +0000 (22:01 -0800)] 
AOSP: e2fsdroid: read and enforce android's permissions

Set the permissions and the extended attributes as defined by fs_config
and selinux.

Test: create an image with make_ext4 and with mke2fs + e2fsdroid
      Compare the output of:
      for f in `find . | sort`; do
          xattr -l "$f"; md5sum "$f" ls -lah "$f"
      done

Change-Id: I64c97f81c7f5e2bcf3cee3431e410d064cf0735a
From AOSP commit: 4c1e1f46301b3ff7f60be1d8e943ecc23b917ca7

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: e2fsdroid: add an option to generate a base_fs file
Adrien Schildknecht [Wed, 30 Nov 2016 05:45:03 +0000 (21:45 -0800)] 
AOSP: e2fsdroid: add an option to generate a base_fs file

Test: make_ext4 and e2fsdroid both generate the same list of file.

Change-Id: Idaf42b64b588824d453bc204562ccbe702de26a9
From AOSP commit: 0fe9949ca0cae4be6cde69e084db922506eda11a

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: e2fsdroid: a tool to create android compatible image
Adrien Schildknecht [Wed, 30 Nov 2016 05:36:43 +0000 (21:36 -0800)] 
AOSP: e2fsdroid: a tool to create android compatible image

Add an option to generate a block_list file from an existing ext4 or sparse
image.

Test: make_ext4 and e2fsdroid both generate the same list of file.

Change-Id: I5ecc6521797397102904bf510c283dfd50a72721
From AOSP commit: fdc29bee07aef3a379f3ec3ccbaa551ff6500bff

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: misc: add callbacks to populate_fs
Adrien Schildknecht [Wed, 30 Nov 2016 05:20:29 +0000 (21:20 -0800)] 
AOSP: misc: add callbacks to populate_fs

This patch let the caller of populate_fs registers a set of callbacks that
will be called everytime an inode is created.

Test: mm

Change-Id: I28ae100c4cc81223192860c29366cbac3077fe21
From AOSP commit: 6686ee96494413b48aa3dd70b5db533cbb7e4852

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: libext2fs: add context to get_alloc_block
Adrien Schildknecht [Wed, 23 Nov 2016 21:02:16 +0000 (13:02 -0800)] 
AOSP: libext2fs: add context to get_alloc_block

This patch add some contexts to the allocator about the block that is about
to be allocated.

The custom Android block allocator need a way to differentiate data block
and metadata block.

Test: cd external/e2fsprogs/lib && mma

Change-Id: I2899936a3a0043d26e062bf1e542483e9a6ac98f
From AOSP commit: 127a599529a0c31d8e3bc4da82a5debd670254b6

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: libext2fs: android sparse io manager
Adrien Schildknecht [Fri, 11 Nov 2016 06:34:32 +0000 (22:34 -0800)] 
AOSP: libext2fs: android sparse io manager

Add a new io manager to directly output sparse images.

Test: mke2fs [...] -E sparse_file;
      simg2img system.img system.ext4;
      e2fsck system.ext4

Change-Id: I41cf8c1b33d359be4f104e03fb4041863214843c
From AOSP commit: f9e0f1d4a7cf32c4091eee7d2a1676cac1d17438

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoAOSP: Fix mac build
Colin Cross [Fri, 21 Oct 2016 23:41:10 +0000 (16:41 -0700)] 
AOSP: Fix mac build

Disable linux-only features in config.h
Fix one use of ino_t instead of ext2_ino_t.

Test: mma -j
Test: e2fsck -f -n $OUT/system.img
Bug: 27599744
Change-Id: I3291ae888ac28a49813365ab2431a3c266de9907
From AOSP commit: bfa685deba9eb828b7ed35d6ccaf0345f6337ce3

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoMerge branch 'maint' into next
Theodore Ts'o [Fri, 19 May 2017 17:27:18 +0000 (13:27 -0400)] 
Merge branch 'maint' into next

7 years agoinclude sys/sysmacros.h as needed
Mike Frysinger [Fri, 19 May 2017 17:25:59 +0000 (13:25 -0400)] 
include sys/sysmacros.h as needed

The minor/major/makedev macros are not entirely standard.  glibc has had
the definitions in sys/sysmacros.h since the start, and wants to move away
from always defining them implicitly via sys/types.h (as this pollutes the
namespace in violation of POSIX).  Other C libraries have already dropped
them.  Since the configure script already checks for this header, use that
to pull in the header in files that use these macros.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agomisc: fix 'zero_hugefiles = false' regression
Eric Biggers [Mon, 8 May 2017 22:47:57 +0000 (15:47 -0700)] 
misc: fix 'zero_hugefiles = false' regression

When mk_hugefiles() was switched to use ext2fs_fallocate(), it was
accidentally changed to ignore the 'zero_hugefiles = false' setting,
which should cause hugefiles to be allocated without initializing their
contents.  Fix this by only passing EXT2_FALLOCATE_ZERO_BLOCKS to
ext2fs_fallocate() when zero_hugefiles is true.

Google-Bug-Id: 38037607
Fixes: 4f868703f6f2 ("libext2fs: use fallocate for creating journals and hugefiles")
Cc: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: eliminate per-block cluster alignment check
Tahsin Erdogan [Sat, 15 Apr 2017 06:24:36 +0000 (23:24 -0700)] 
e2fsck: eliminate per-block cluster alignment check

scan_extent_node() did cluster alignment check for every block in an
extent. This is unnecessary and significantly slows down the runtime
when hugefile is used with bigalloc.

Do cluster alignment check once for each extent.

Google-Bug-Id: 36886699

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoMerge branch 'maint' into next
Theodore Ts'o [Wed, 26 Apr 2017 16:03:27 +0000 (12:03 -0400)] 
Merge branch 'maint' into next

7 years agotests: skip running long test with "make check" and add "make fullcheck"
Theodore Ts'o [Wed, 26 Apr 2017 14:07:18 +0000 (10:07 -0400)] 
tests: skip running long test with "make check" and add "make fullcheck"

Don't run tests which take longer than 20 seconds to run (especially
f_large_dir, whose run time is well over ten minutes) for "make
check".  The new "make fullcheck" will run all of the regression tests
for e2fsprogs.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agotests: fix bash'isms in f_large_dir
Theodore Ts'o [Wed, 26 Apr 2017 05:05:56 +0000 (01:05 -0400)] 
tests: fix bash'isms in f_large_dir

Fix portability problems in the test script for f_large_dir.  Also
clean up messages that the script prints while it runs (and
unfortunately it takes a very long time to run).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: fix ASAN error when using 128 byte inodes
Theodore Ts'o [Sat, 15 Apr 2017 14:33:53 +0000 (10:33 -0400)] 
e2fsck: fix ASAN error when using 128 byte inodes

Due to the inode table buffering, it's actually hard to overrun the
end of allocated memory, so the ASAN error doesn't trigger all the
time.

Google-Bug-Id: 37326362

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: allow extent tree optimization to be disabled
Theodore Ts'o [Sat, 15 Apr 2017 13:22:27 +0000 (09:22 -0400)] 
e2fsck: allow extent tree optimization to be disabled

Add an extended option, -E no_optimize_extents, as well as a
e2fsck.conf profile option, to disable extent tree optimization.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agotests: add new test f_quota_extent_opt
Theodore Ts'o [Sat, 15 Apr 2017 04:59:11 +0000 (00:59 -0400)] 
tests: add new test f_quota_extent_opt

Add a test to validate the changes in commit 403bcb668e4f: "e2fsck:
update quota when optimizing the extent tree".

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: update quota when optimizing the extent tree
Theodore Ts'o [Sat, 15 Apr 2017 04:29:46 +0000 (00:29 -0400)] 
e2fsck: update quota when optimizing the extent tree

If quota is enabled, optimizing the extent tree wouldn't update the
in-memory quota statistics, so that a subsequent e2fsck run would show
that the quota usage statistics on disk were incorrect.

Google-Bug-Id: 36391645

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: fix type mismatch bug in the largedir patch
Theodore Ts'o [Fri, 14 Apr 2017 20:44:16 +0000 (16:44 -0400)] 
e2fsck: fix type mismatch bug in the largedir patch

Commit ae9efd05a986: "e2fsck: 3 level hash tree directory
optimization" introduced a bug when checking for the largedir feature.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agotests: 3 level hash tree test
Artem Blagodarenko [Wed, 15 Feb 2017 15:45:47 +0000 (18:45 +0300)] 
tests: 3 level hash tree test

Test is added that recreate directory (-fD fsck option)
with 47.5k of 255-symbol name files. This amount of files
can not be stored only in 2 hevel htree, so 3 levels are used.

Signed-off-by: Artem Blagodarenko <artem.blagodarenko@seagate.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: 3 level hash tree directory optimization
Artem Blagodarenko [Wed, 15 Feb 2017 17:45:00 +0000 (20:45 +0300)] 
e2fsck: 3 level hash tree directory optimization

e2fsck fix for partitions with 3 level hash directries.
Additional level is added to e2fsck -D codepath.

Signed-off-by: Artem Blagodarenko <artem.blagodarenko@seagate.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsprogs: add support for 3-level htree
Artem Blagodarenko [Wed, 15 Feb 2017 17:43:15 +0000 (20:43 +0300)] 
e2fsprogs: add support for 3-level htree

The INCOMPAT_LARGEDIR feature allows larger directories to
be created, both with directory sizes over 2GB and and a
maximum htree depth of 3 instead of the current limit of 2.
These features are needed in order to exceed the currently
limit of approximately 10M entries in a single directory
for 4KB blocksize (~100k for 1KB).

debugfs, e2fsck, ext2fs, mke2fs and tune2fs support is
added.

Signed-off-by: Alexey Lyashkov <alexey.lyashkov@seagate.com>
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@seagate.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsprogs: supersede i_dir_acl with i_size_high for all cases
Artem Blagodarenko [Mon, 13 Feb 2017 09:20:14 +0000 (12:20 +0300)] 
e2fsprogs: supersede i_dir_acl with i_size_high for all cases

This patch removes i_dir_acl macros and macros users.
Now stucture field can be accessed as i_size_high. This field
is useful for largedir feature.

Signed-off-by: Alexey Lyashkov <alexey.lyashkov@seagate.com>
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@seagate.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe4crypt: fix error handling for KEYCTL_GET_KEYRING_ID
Joe Richey [Mon, 3 Apr 2017 16:52:50 +0000 (16:52 +0000)] 
e4crypt: fix error handling for KEYCTL_GET_KEYRING_ID

Due to some interesting behaviour in keyctl (as described in the
comments), we use KEYCTL_GET_KEYRING_ID to translate the special value
of KEY_SPEC_SESSION_KEYRING to a real keyring id. However, how we
currently do this is flawed in two ways.

First, if KEYCTL_GET_KEYRING_ID fails, we don't detect it as it returns
-1 and zero is used for an error value in get_keyring_id. Second, if the
user specifies "-k @s" the translation never runs and the undesireable
behavior occurs.

These are both fixed by doing the translation outside of get_keyring_id.

Signed-off-by: Joe Richey <joerichey@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: fix quota accounting to use cluster units
Eric Whitney [Sun, 2 Apr 2017 16:57:05 +0000 (12:57 -0400)] 
e2fsck: fix quota accounting to use cluster units

The quota accounting code in e2fsck's pass 1 and pass 3 uses block units
rather than cluster units when recording the allocated space consumed by
files and directories.  In pass 1, this causes a large undercount of
actual quota results and test failures for xfstests generic/383, /384,
/385, and /386 on bigalloc file systems.  In pass 3, this results in
quota accounting errors when the lost+found directory is either extended
or recreated on a bigalloc file system.

Use clusters rather than blocks when accounting for allocated space,
and correct a related header comment in the quota code.

Note that pass 1b also contains call sites for quota_data_sub() that
also need to be addressed.  However, it appears that more than just
unit conversion may be needed, so that will be left to a future patch.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolibext2fs: apply LDFLAGS when building tst_inline_data
Eric Biggers [Fri, 17 Mar 2017 22:38:36 +0000 (15:38 -0700)] 
libext2fs: apply LDFLAGS when building tst_inline_data

If libext2fs was compiled with an external libblkid pointed to by
LDFLAGS, then linking the tst_inline_data program failed because the
requested linker flags were not used.  Fix this by adding $(ALL_LDFLAGS)
to the build rule, as is done for the other test programs.

Fixes: 31253488385a ("libext2fs: add a unit test for inline data")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: fix type mismatches in quota warning message
Eric Whitney [Fri, 31 Mar 2017 23:21:59 +0000 (19:21 -0400)] 
e2fsck: fix type mismatches in quota warning message

The conversion operations in the format control strings found in the
fprintf call used to print the quota warning message do not match the
types of their corresponding arguments.  Although this probably hasn't
generally been a problem, it obfuscates a bigalloc quota accounting bug
where the reported actual quota goes negative.

Clean up the mismatches and some unnecessary casts.  While we're at it,
fix a spelling nit in a related comment.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoFix metadata_csum typo in ext4 man page
Justin Bronder [Fri, 31 Mar 2017 14:24:39 +0000 (10:24 -0400)] 
Fix metadata_csum typo in ext4 man page

Signed-off-by: Justin Bronder <jsbronder@cold-front.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
7 years agomisc: fix all the compiler warnings
Darrick J. Wong [Thu, 2 Mar 2017 04:52:12 +0000 (20:52 -0800)] 
misc: fix all the compiler warnings

Fix the various compiler warnings that have crept in, and only define
__bitwise if the system headers haven't already done so.  Linux 4.10
changes the __bitwise definition so that our redefinition here is
just different enough that gcc complains.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agotests: fix test failure in f_detect_xfs caused by commit bf615bb0ccad
Theodore Ts'o [Fri, 3 Mar 2017 15:00:17 +0000 (10:00 -0500)] 
tests: fix test failure in f_detect_xfs caused by commit bf615bb0ccad

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolibext2fs: readahead for meta_bg
Alexey Lyashkov [Wed, 1 Mar 2017 20:03:54 +0000 (15:03 -0500)] 
libext2fs: readahead for meta_bg

There are ~37k of random IOs with meta_bg option on 300T target.
Debugfs requires 20 minutes to be started. Enabling readahead for
group blocks metadata save time dramatically. Only 12s to start.

Signed-off-by: Alexey Lyashkov <alexey.lyashkov@seagate.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
7 years agoe2fsck: report the exit value in the logfile
Theodore Ts'o [Wed, 1 Mar 2017 19:33:45 +0000 (14:33 -0500)] 
e2fsck: report the exit value in the logfile

If e2fsck logging is enabled, report the exit value as the last line
in the log file.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Mon, 20 Feb 2017 02:45:43 +0000 (21:45 -0500)] 
po: update uk.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Mon, 20 Feb 2017 02:45:43 +0000 (21:45 -0500)] 
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Mon, 20 Feb 2017 02:45:42 +0000 (21:45 -0500)] 
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Mon, 20 Feb 2017 02:45:42 +0000 (21:45 -0500)] 
po: update nl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Mon, 20 Feb 2017 02:45:42 +0000 (21:45 -0500)] 
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agopo: update es.po (from translationproject.org)
Antonio Ceballos [Mon, 20 Feb 2017 02:45:42 +0000 (21:45 -0500)] 
po: update es.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agopo: update da.po (from translationproject.org)
Joe Hansen [Mon, 20 Feb 2017 02:45:42 +0000 (21:45 -0500)] 
po: update da.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Mon, 20 Feb 2017 02:45:42 +0000 (21:45 -0500)] 
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebugfs: better support of superblocks with bad checksums
Theodore Ts'o [Mon, 20 Feb 2017 02:08:21 +0000 (21:08 -0500)] 
debugfs: better support of superblocks with bad checksums

Allow debugfs to open file systems with a bad checksum, and teach the
show_super_stats command to print the expected checksum value.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoDo interim update of RELEASE NOTES
Theodore Ts'o [Fri, 17 Feb 2017 20:18:10 +0000 (15:18 -0500)] 
Do interim update of RELEASE NOTES

7 years agoe2fsck: make problem comments match error messages
Andreas Dilger [Fri, 17 Feb 2017 17:57:29 +0000 (12:57 -0500)] 
e2fsck: make problem comments match error messages

Since the @x compression obscures e2fsck problem error messages
from being found by normal searching, make the comment for each
error match the actual error message so that they can be found
more easily.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: don't check inode flag values for deleted inodes
Theodore Ts'o [Fri, 17 Feb 2017 15:42:17 +0000 (10:42 -0500)] 
e2fsck: don't check inode flag values for deleted inodes

Commit 47b8941774df "e2fsck: make sure system.data xattr is present"
exposed a bug in e2fsck's pass 1 handling which caused the xfstests's
generic/079 to fail if the inline_data feature was enabled.  The
problem was that e2fsck was checking if an inode with inline data had
the system.xattr EA before checking to see if that inode was still in
use --- and this invariant isn't necessarily true for deleted inodes.
There were a number of other checks that were done too early that
could also potentially cause false positive complaints, although those
would normally only happen if a now-unused portion of the inode table
had gotten corrupted, or if tune2fs had disabled a particular file
system feature and there old, deleted inodes that had values
inconsistent with the new file system configuration.

Reported-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoe2fsck: exit with exit status 0 if no errors were fixed
Theodore Ts'o [Fri, 17 Feb 2017 03:02:35 +0000 (22:02 -0500)] 
e2fsck: exit with exit status 0 if no errors were fixed

Previously, e2fsck would exit with a status code of 1 even though the
only changes that it made to the file system were various
optimziations and not fixing file system corruption.  Since the man
page states that an exit status of 1 means "file system errors
corrupted", fix e2fsck to return an exit status of 0.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agoRefactor code to print journal superblock information
Theodore Ts'o [Thu, 16 Feb 2017 23:54:41 +0000 (18:54 -0500)] 
Refactor code to print journal superblock information

Move the code to list the journal superblock information to libe2p, so
it can be used by debugfs, and so we don't have two copies of
substantially the same code in dumpe2fs.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolibext2fs: remove unused jfs_dat.h file
Theodore Ts'o [Thu, 16 Feb 2017 20:11:23 +0000 (15:11 -0500)] 
libext2fs: remove unused jfs_dat.h file

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agodebugfs: with ls -l, include space between size and date
Eric Biggers [Mon, 13 Feb 2017 00:01:40 +0000 (16:01 -0800)] 
debugfs: with ls -l, include space between size and date

Before:
     11   40700 (2)      0      0   1228812-Feb-2017 12:51 lost+found

After:
     11   40700 (2)      0      0   12288 12-Feb-2017 12:51 lost+found

Fixes: 68a1de3df340 ("debugfs: pretty print encrypted filenames in the ls command")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
7 years agodebugfs.8: fix name of argument to blocks command
Eric Biggers [Mon, 13 Feb 2017 00:00:09 +0000 (16:00 -0800)] 
debugfs.8: fix name of argument to blocks command

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 years agolibsupport: remove debugging printf() from parse_qtype.c
Theodore Ts'o [Thu, 16 Feb 2017 16:19:51 +0000 (11:19 -0500)] 
libsupport: remove debugging printf() from parse_qtype.c

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