]> git.ipfire.org Git - thirdparty/e2fsprogs.git/log
thirdparty/e2fsprogs.git
6 years agodebian: fix FTBFS regression caused by debhelper/10.9
Theodore Ts'o [Mon, 16 Oct 2017 04:38:00 +0000 (00:38 -0400)] 
debian: fix FTBFS regression caused by debhelper/10.9

The problem is caused by obsolete packages referenced in the rules
file.  The latest version of debhelper is no longer forgiving about
non-existing packages being referenced in debhelper commands.

Addresses-Debian-Bug: #876551
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: fix potential memory access overrun in ext2fs_inode_csum()
Theodore Ts'o [Mon, 16 Oct 2017 04:28:45 +0000 (00:28 -0400)] 
libext2fs: fix potential memory access overrun in ext2fs_inode_csum()

If the superblock has a revision level of 0, then s_inode_size is
undefined, and the actual inode size is 128 bytes.  This is handled by
the EXT2_INODE_SIZE() helper macro.  If s_inode_size is maliciously
set to a large value, and the s_rev_level is 0, then this could result
in an illegal memory pointer dereference.

Addresses-Debian-Bug: #878104
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoFix spelling typos in contrib/android code
Theodore Ts'o [Mon, 16 Oct 2017 03:22:05 +0000 (23:22 -0400)] 
Fix spelling typos in contrib/android code

These typos were found by Sebastian Rasmussen <sebras@gmail.com>

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoMerge branch 'maint' into next
Theodore Ts'o [Mon, 16 Oct 2017 03:20:53 +0000 (23:20 -0400)] 
Merge branch 'maint' into next

6 years agoFix historic typos in changelogs and release notes
Sebastian Rasmussen [Mon, 16 Oct 2017 03:18:25 +0000 (23:18 -0400)] 
Fix historic typos in changelogs and release notes

Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoFix typos in code comments and developer docs
Sebastian Rasmussen [Sun, 8 Oct 2017 11:30:08 +0000 (13:30 +0200)] 
Fix typos in code comments and developer docs

Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
6 years agoFix typos in error messages and documentation
Sebastian Rasmussen [Sat, 14 Oct 2017 18:44:54 +0000 (20:44 +0200)] 
Fix typos in error messages and documentation

Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
6 years agotests: log tests that are taking a long time
Andreas Dilger [Mon, 16 Oct 2017 02:28:39 +0000 (22:28 -0400)] 
tests: log tests that are taking a long time

Create a .slow file for tests that take too long to run, so it is
possible to find them easily after all of the tests have run.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agodebugfs: print "Xst" bits of file mode via stat
Andreas Dilger [Mon, 16 Oct 2017 02:27:40 +0000 (22:27 -0400)] 
debugfs: print "Xst" bits of file mode via stat

Currently, debugfs does not print the Xst high-order mode bits
in the "stat" output.  While "ls -l" shows these bits are set:

  # ls -il /mnt/tmp/O/0/d2/406306
  1588 0 -rwSrwSrw- 1 root root 0 Dec 31  1969 /mnt/tmp/O/0/d2/406306

debugfs currently only prints the low nine "ugo" mode bits:

  # debugfs -c -R "stat O/0/d2/406306" /dev/vgmyth/lvmythost4
  Inode: 1588   Type: regular    Mode:  0666   Flags: 0x80000

Fix debugfs so that the high-order mode bits are also printed,
if available, otherwise only print the standard low mode bits.

  # debugfs -c -R "stat O/0/d2/406306" /dev/vgmyth/lvmythost4
  Inode: 1588   Type: regular    Mode:  06666   Flags: 0x80000

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoMerge branch 'maint' into next
Theodore Ts'o [Sun, 15 Oct 2017 20:37:10 +0000 (16:37 -0400)] 
Merge branch 'maint' into next

6 years agotests: shorten test descriptions to fit in 80 columns
Andreas Dilger [Sun, 15 Oct 2017 20:23:24 +0000 (16:23 -0400)] 
tests: shorten test descriptions to fit in 80 columns

While not critical to functionality, it is easier to see the pass/fail
status of each test if they are not wrapped onto the next line.
Shorten test descriptions so the name+description fit in 80 columns.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoAdd various miscellaneous generated files to the gitignore file
Andreas Dilger [Sun, 15 Oct 2017 20:21:13 +0000 (16:21 -0400)] 
Add various miscellaneous generated files to the gitignore file

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotests: fix d_inline_dump and f_mke2fs_baddisk from leaving behind temp files
Theodore Ts'o [Sun, 15 Oct 2017 20:19:04 +0000 (16:19 -0400)] 
tests: fix d_inline_dump and f_mke2fs_baddisk from leaving behind temp files

These two tests could leave an temp file behind if the test is
skipped.  In general test script files should avoid using 'exit',
since this bypasses the test cleanup scripting.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotests: don't leave temporary files at end of test
Andreas Dilger [Tue, 10 Oct 2017 22:39:52 +0000 (16:39 -0600)] 
tests: don't leave temporary files at end of test

Don't leave temp files around after test has completed successfully.
Some test scripts were creating their own temporary files, and in
some cases test_one was skipping a test completely (e.g. slow) after
the temp file had been created.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agomisc: clean up error handling for ext2fs_run_ext3_journal()
Theodore Ts'o [Sun, 15 Oct 2017 04:22:20 +0000 (00:22 -0400)] 
misc: clean up error handling for ext2fs_run_ext3_journal()

The ext2fs_run_ext3_journal() function is in debugfs/journal.c, and in
some error conditions cases may close the passed-in file system handle.

Clean up the both the function so that it reliably clears the file
system handle if it has been freed, and its callers so that they do
not crash by dereferencing a null pointer if it has been freed.

Reported-by: Erkki Ruohtula <eru@netti.fi>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotests: add new test r_move_itable_nostride
Theodore Ts'o [Sat, 14 Oct 2017 15:29:21 +0000 (11:29 -0400)] 
tests: add new test r_move_itable_nostride

This a regression test for ca74ecf32569: "libext2fs: skip start_blk
adjustment when stride and flex_bg is set"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotests: add new test r_move_itable_realloc
Theodore Ts'o [Sat, 14 Oct 2017 15:18:44 +0000 (11:18 -0400)] 
tests: add new test r_move_itable_realloc

This is a regression test for 0c12896e08d9: "libext2fs: prevent
allocating inode table from already used blocks"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: skip start_blk adjustment when stride and flex_bg is set
Lukas Czerner [Sat, 14 Oct 2017 14:42:30 +0000 (10:42 -0400)] 
libext2fs: skip start_blk adjustment when stride and flex_bg is set

Currently some stride optimization is done in
ext2fs_allocate_group_table() by adjusting start_blk block where we
start allocating block, or inode bitmaps.

However in flex_bg case this is currently useless since the values are
going to be overridden anyway. Moreover in flex_bg case the group might
already be full and the stride optimization will fail. As a result file
system resize might fail needlessly in some situations.

It can be shown by this example:

mke2fs -b 1024 -i 1024 -E stride=8192 -t ext4 /dev/loop0 1024000
resize2fs /dev/loop0 102400000
resize2fs 1.43.5 (04-Aug-2017)
Resizing the filesystem on /dev/loop0 to 102400000 (1k) blocks.
./resize/resize2fs: Could not allocate block in ext2 filesystem while trying to resize /dev/loop0
Please run 'e2fsck -fy /dev/loop0' to fix the filesystem
after the aborted resize operation.

Fix this by not doing the stride adjustment in case of flex_bg.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: prevent allocating inode table from already used blocks
Lukas Czerner [Sat, 14 Oct 2017 14:33:10 +0000 (10:33 -0400)] 
libext2fs: prevent allocating inode table from already used blocks

Currently it's possible for ext2fs_allocate_group_table() to place inode
tables to blocks that are already occupied by different inode table.
This can be reproduced by resize2fs on the file system where we need to
move more than one inode table to a different location due to increase
in group descriptor blocks, inode and block bitmaps.

Best way I can reproduce this is to create big enough file system with
huge amount of inodes and without resize_inode

mke2fs -F -b 1024 -i 1024 -O ^resize_inode -t ext4 /dev/loop0 1024000
resize2fs /dev/loop0 10240000

e2fsck -fn /dev/loop0 | less
e2fsck 1.43.5 (04-Aug-2017)
ext2fs_check_desc: Corrupt group descriptor: bad block for inode table
e2fsck: Group descriptors look bad... trying backup blocks...
e2fsck: The journal superblock is corrupt while checking journal for /dev/loop0
e2fsck: Cannot proceed with file system check
Superblock has an invalid journal (inode 8).
Clear? no

/dev/loop0: ********** WARNING: Filesystem still has errors **********

None of the settings are strictly necessary and it can be reproducer in
various ways. This is just an example of one easy way to reproduce this.

This bug was introduced with commit fccdbac39454 ("libext2fs: optimize
ext2fs_allocate_group_table()") and is caused by the fact that wrong
bitmap is used to mark the blocks as used.

Fix this by using ext2fs_mark_block_bitmap_range2() in both (flex_bg and
non flex_bg) cases and handle flex_bg case manually instead of relying
on ext2fs_block_alloc_stats_range() because there is no way in that
function to use different bitmap than fs->block_map.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agomke2fs: fix spelling typo
Theodore Ts'o [Wed, 20 Sep 2017 05:10:01 +0000 (01:10 -0400)] 
mke2fs: fix spelling typo

Reported-by: Philipp Thomas <pth@suse.de>
Signed-off-by: Philipp Thomas <pth@suse.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: remove useless test and assignment in strtohashbuf()
Damien Guibouret [Thu, 7 Sep 2017 01:53:32 +0000 (21:53 -0400)] 
libext2fs: remove useless test and assignment in strtohashbuf()

On transformation of str to hash, computed value is initialised before
first byte modulo 4. But it is already initialised before entering loop
and after processing last byte modulo 4. So the corresponding test and
initialisation could be removed.

Signed-off-by: Damien Guibouret <damien.guibouret@partition-saving.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agomke2fs.conf: enable metadata_csum by default
Theodore Ts'o [Thu, 7 Sep 2017 01:32:01 +0000 (21:32 -0400)] 
mke2fs.conf: enable metadata_csum by default

For the 1.44 release, will be enabling the metadata_csum feature by
default.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoMerge branch 'maint' into next
Theodore Ts'o [Thu, 7 Sep 2017 01:13:09 +0000 (21:13 -0400)] 
Merge branch 'maint' into next

6 years agodebian: replace priority: extra with priority: optional
Theodore Ts'o [Thu, 7 Sep 2017 01:02:49 +0000 (21:02 -0400)] 
debian: replace priority: extra with priority: optional

As of Debian policy 4.0.1, the "extra" priority has been deprecated.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoe2fsck, libext2fs: add checks for insanely large file systems
Theodore Ts'o [Tue, 5 Sep 2017 00:32:22 +0000 (20:32 -0400)] 
e2fsck, libext2fs: add checks for insanely large file systems

If the blocks count field is too large, this can cause numeric
overflows which can result in buffer overflows.

Addresses-Debian-Bug: #873757

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reported-by: Jakub Wilk <jwilk@jwilk.net>
6 years agodebian: promote e2fsprogs-l10n from suggests to recommends
Theodore Ts'o [Mon, 4 Sep 2017 04:06:10 +0000 (00:06 -0400)] 
debian: promote e2fsprogs-l10n from suggests to recommends

Addresses-Debian-Bug: #873812

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agodebian: remove zsh30-static recommendation from package control file
Theodore Ts'o [Mon, 4 Sep 2017 04:04:59 +0000 (00:04 -0400)] 
debian: remove zsh30-static recommendation from package control file

The zsh30-static package hasn't existed in a very long time.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agodebian: clean up conditional fuse2fs pacakge build rules
Theodore Ts'o [Mon, 4 Sep 2017 03:53:57 +0000 (23:53 -0400)] 
debian: clean up conditional fuse2fs pacakge build rules

There's no point conditionalizing fuse2fs in the control file, since
we control whether or not fuse2fs is built in the rules file, and the
control file is going to be the same when built on all of the debian
build servers.

Also key off of DEB_HOST_ARCH_OS to determine whether or not we are
building for the Hurd, and define it so the right thing happens if
./debian/rules is run by hand on a Hurd system.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agodebian: make e2fsprogs-l10n be arch:all
Theodore Ts'o [Mon, 4 Sep 2017 02:40:23 +0000 (22:40 -0400)] 
debian: make e2fsprogs-l10n be arch:all

Addresses-Debian-Bug: 873813

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotests: report if a test is taking a long time
Andreas Dilger [Wed, 30 Aug 2017 06:05:25 +0000 (02:05 -0400)] 
tests: report if a test is taking a long time

Print out a message if a test takes longer than 60s, with a
reminder to potentially add is_slow_test to that test, so
that it is easier to find which tests are taking a long time,
especially if running with "make -j check" or similar.

Add an exclusion for r_expand_full on MacOS since HFS+ does
not support sparse devices and doesn't like large test images.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotune2fs: quiet llvm build warning
Andreas Dilger [Wed, 30 Aug 2017 05:56:08 +0000 (01:56 -0400)] 
tune2fs: quiet llvm build warning

Quiet a relatively harmless build warning:

tune2fs.c:928:18: warning: '&&' within '||' [-Wlogical-op-parentheses]
if (pass == 1 && (inode->i_flags & EXT4_EA_INODE_FL) ||
    ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~
tune2fs.c:928:18: place parentheses around '&&' to silence warning

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoFix Debian packaging warnings for the 1.43.6 release v1.43.6
Theodore Ts'o [Tue, 29 Aug 2017 13:04:45 +0000 (09:04 -0400)] 
Fix Debian packaging warnings for the 1.43.6 release

Added a missing ${misc:Depends} to a new package, and removed an
extraneous configure option (--enable-quota was removed as of
e2fsprogs 1.43.)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoMerge branch 'maint' into next
Theodore Ts'o [Tue, 29 Aug 2017 12:03:31 +0000 (08:03 -0400)] 
Merge branch 'maint' into next

6 years agoUpdate release notes, etc., for the 1.43.6 release
Theodore Ts'o [Wed, 23 Aug 2017 23:46:04 +0000 (19:46 -0400)] 
Update release notes, etc., for the 1.43.6 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoSearch for GNU-compatible dd for self-tests.
Matthias Andree [Tue, 29 Aug 2017 05:02:36 +0000 (01:02 -0400)] 
Search for GNU-compatible dd for self-tests.

This checks for a dd that supports iflag=fullblock oflag=append,
and looks at gdd and dd for now, and warns of failing self-tests
if neither supports these two flags.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoFix FreeBSD portability problem caused by it using character mode disk devices
Theodore Ts'o [Mon, 28 Aug 2017 22:04:11 +0000 (18:04 -0400)] 
Fix FreeBSD portability problem caused by it using character mode disk devices

We were using S_ISBLK() to test if a device could be used as a disk
device.  This doesn't work for FreeBSD.  We need to test for S_ISBLK()
|| S_ISCHR().

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Mon, 28 Aug 2017 20:27:29 +0000 (16:27 -0400)] 
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoSilence valgrind warnings
Theodore Ts'o [Sat, 26 Aug 2017 17:42:30 +0000 (13:42 -0400)] 
Silence valgrind warnings

Valgrind doesn't understand that the kernel will be initializing the
struct termios and struct loop_info64 structures.  Since they occur in
functions which are not in the hot path, preinitialize to zero to
prevent valgrind from producing a huge number of false positives.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoe2fsck: add optimization for heavily hard-linked file systems
Jaco Kroon [Wed, 23 Aug 2017 18:21:43 +0000 (14:21 -0400)] 
e2fsck: add optimization for heavily hard-linked file systems

In the case of file system with large number of hard links, e2fsck can
take a large amount of time in pass 2 due to binary search lookup of
inode numbers.  This implements a memory trade-off (storing 2 bytes
in-memory for each inode to store inode counts).

For a 40TB filesystem with 2.8bn inodes this map alone requires 5.7GB
of RAM.  For this reason, we don't enable this optimization by
default.  It can be enabled using either an extended option to e2fsck
or via a seting in e2fsck.conf.

Even when the fullmap optimization is enabled, we don't use this for
the icount structure in pass 1.  This is because the gain CPU gain is
nearly nil for that pass and the sacrificed memory does not justify
the increase in RAM.

(It could be that during pass 1, if more than 17% if possible inodes
has link_count>1 (466m inodes in the 40TB with 2.8bn possible inodes
case) then it becomes more memory efficient to use the full map
implementation in terms of memory.  However, this is extremely
unlikely given that most file systems are heavily over-provisioned in
terms of the number of inodes in the system.)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoe2fsck: optimize out the use region_t in scan_extent_node()
Jaco Kroon [Wed, 23 Aug 2017 17:54:25 +0000 (13:54 -0400)] 
e2fsck: optimize out the use region_t in scan_extent_node()

Since extents have a guarantee of being monotonically increasing we
merely need to check that block n+1 starts after block n.  This is a
simple enough check and we can perform this by calculating the next
expected logical block instead of using the region usage tracking data
abstraction.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotune2fs, mke2fs: clarify proceed delay question
Theodore Ts'o [Wed, 23 Aug 2017 15:03:37 +0000 (11:03 -0400)] 
tune2fs, mke2fs: clarify proceed delay question

The explanation of the what happens after delaying N seconds is
ambiguous.  Clarify what happens.

Addresses-Debian-Bug: #857336

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotune2fs: explain why an fsck is needed
Theodore Ts'o [Wed, 23 Aug 2017 14:57:25 +0000 (10:57 -0400)] 
tune2fs: explain why an fsck is needed

Currently tune2fs just says without any explanation, "run fsck -f".
Add a short explanation that a freshly checked file system is required
to reduce user confusion.  (We could add even more details, but
hopefully this is enough.)

Addresses-Debian-Bug: #857336

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotune2fs: do not enable project feature or quota if inode size is 128 bytes
Theodore Ts'o [Wed, 23 Aug 2017 14:44:44 +0000 (10:44 -0400)] 
tune2fs: do not enable project feature or quota if inode size is 128 bytes

Don't allow the user to enable the project feature (or project quota)
if the inode size is 128 bytes.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agomke2fs: automatically use 256 byte inodes if project feature enabled
Theodore Ts'o [Wed, 23 Aug 2017 14:30:09 +0000 (10:30 -0400)] 
mke2fs: automatically use 256 byte inodes if project feature enabled

If the inode size is not implicitly requested on the command line, and
it is too small to support the project feature, automatically promote
the inode size to be 256 bytes so that the project feature will work.

Note the previous test to check for a too-small inode size didn't work
because it checked before inode size was set in fs_param.  Hence, it
was possible to create file systems with a 128 byte inode and the
project feature enabled.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agomke2fs.conf: remove legacy entry for ext4dev
Theodore Ts'o [Wed, 23 Aug 2017 14:04:54 +0000 (10:04 -0400)] 
mke2fs.conf: remove legacy entry for ext4dev

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: fix Large File Support bug in ext2fs_image_inode_write()
Theodore Ts'o [Tue, 22 Aug 2017 21:09:31 +0000 (17:09 -0400)] 
libext2fs: fix Large File Support bug in ext2fs_image_inode_write()

We were using lseek() instead of ext2fs_llseek().  This caused e2image
to fail when writing an old-style e2image file if it was larger than
2 GiB.

Addresses-Debian-Bug: #855246

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoe2fsck: fix the message printed for the project quota type
Theodore Ts'o [Tue, 22 Aug 2017 19:40:23 +0000 (15:40 -0400)] 
e2fsck: fix the message printed for the project quota type

Fix a cut and paste error so print_e2fsck_message() correctly prints
the quota type for project quotas.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reported-by: Jakub Bogusz <qboosh@pld-linux.org>
6 years agoMerge branch 'maint' into next
Theodore Ts'o [Tue, 22 Aug 2017 16:19:30 +0000 (12:19 -0400)] 
Merge branch 'maint' into next

6 years agodebian: remove support for pre-multiarch versions of Debian
Theodore Ts'o [Tue, 22 Aug 2017 16:15:26 +0000 (12:15 -0400)] 
debian: remove support for pre-multiarch versions of Debian

All versions of Debian after Wheezy support Multiarch, so we can
simply the Debian control.in and rules file by removing support for
older versions of Debian without Multiarch support.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: avoid potential out-of-bounds write if pread/pread64 fails
Theodore Ts'o [Tue, 22 Aug 2017 15:23:21 +0000 (11:23 -0400)] 
libext2fs: avoid potential out-of-bounds write if pread/pread64 fails

In unix_io.c's raw_read_block(), if the initial attempt to call
pread/pread64 fails because the offset is insane, the variable
"actual" is left at -1, and then when lseek fails, the cleanup
function will try to clear (as an out-of-bounds write) a single byte
before the buffer.  Fix this.

Addresses-Debian-Bug: #871539

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reported-by: Jakub Wilk <jwilk@jwilk.net>
6 years agodebian: remove support libuuid/libblkid packages
Theodore Ts'o [Tue, 22 Aug 2017 14:37:10 +0000 (10:37 -0400)] 
debian: remove support libuuid/libblkid packages

Remove support for util-linux prior to 2.16, when e2fsprogs provided
its own copy of libuuid and libblkid.  This is only needed for Debian
distributions prior to Wheezy, which is no longer supported.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibsupport: don't try accessing the project quota for 128 byte inodes
Theodore Ts'o [Tue, 22 Aug 2017 04:54:15 +0000 (00:54 -0400)] 
libsupport: don't try accessing the project quota for 128 byte inodes

If the file system has 128 byte inode, it's not possible to access its
project quota id, since the inode is too small.  So prevent a
potential out-of-bounds read in get_qid().

The problem was found by valgrind and American Fuzzy Lop.

Address-Debian-Bug: #871540

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agodebian: break out locale files into a separate package
Theodore Ts'o [Tue, 22 Aug 2017 03:41:35 +0000 (23:41 -0400)] 
debian: break out locale files into a separate package

Since e2fsprogs is a required/essential package, this allows us to
significantly shrink the size of the a minbase setup.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agopo: update vi.po (from translationproject.org)
Trần Ngọc Quân [Tue, 22 Aug 2017 01:45:28 +0000 (21:45 -0400)] 
po: update vi.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Tue, 22 Aug 2017 01:45:28 +0000 (21:45 -0400)] 
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Tue, 22 Aug 2017 01:45:27 +0000 (21:45 -0400)] 
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Tue, 22 Aug 2017 01:45:27 +0000 (21:45 -0400)] 
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoRevert "mke2fs: fix UI problem caused by fuzzy translations"
Theodore Ts'o [Tue, 22 Aug 2017 01:32:26 +0000 (21:32 -0400)] 
Revert "mke2fs: fix UI problem caused by fuzzy translations"

This reverts commit f25b334c5093a1a5e2985c7ed58213a52ba06329.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoe2fsck: in ask_yn() fall back to English yes/no characters
Theodore Ts'o [Tue, 22 Aug 2017 01:20:38 +0000 (21:20 -0400)] 
e2fsck: in ask_yn() fall back to English yes/no characters

In the case of missing translations, if the translation for y/n is
missing due to fuzzy transactions, such that user is told to use
<y/n>, those characters will work correctly.

Addresses-Debian-Bug: #856586

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoe2fsck: add optimization for large, fragmented sparse files
Theodore Ts'o [Mon, 14 Aug 2017 23:52:39 +0000 (19:52 -0400)] 
e2fsck: add optimization for large, fragmented sparse files

The code which checks for overlapping logical blocks in an extent tree
is O(h*e) in time, where h is the number of holes in the file, and e
is the number of extents in the file.  So a file with a large number
of holes can take e2fsck a long time process.  Optimize this taking
advantage of the fact the vast majority of the time, region_allocate()
is called with increasing logical block numbers, so we are almost
always append onto the end of the region list.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoMerge branch 'maint' into next
Theodore Ts'o [Mon, 14 Aug 2017 02:40:15 +0000 (22:40 -0400)] 
Merge branch 'maint' into next

6 years agomke2fs: fix UI problem caused by fuzzy translations
Theodore Ts'o [Mon, 14 Aug 2017 01:07:21 +0000 (21:07 -0400)] 
mke2fs: fix UI problem caused by fuzzy translations

When the original message was changed from "(y, n)" to "(y, N)", this
caused the translations to be marked as "fuzzy".  For those
translations that use a different characters for yes and no --- for
example, German, which uses j and n for "ja" and "nein" --- not having
the translation can cause user confusion since the user will type 'y',
and it will be interpreted as "No", since mke2fs is expecting that the
user will type some other character, such as 'j' or 'J' for "Ja" in
the German locale.

Addresses-Debian-Bug: #856586

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoAdd options to gzip and tar to create reproducible artificats
Theodore Ts'o [Sun, 13 Aug 2017 23:54:30 +0000 (19:54 -0400)] 
Add options to gzip and tar to create reproducible artificats

Also remove some long-unused rules from resize2fs's Makefile.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotests: disable use of the BLKID cache while running regression tests
Theodore Ts'o [Sun, 13 Aug 2017 21:52:20 +0000 (17:52 -0400)] 
tests: disable use of the BLKID cache while running regression tests

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibsupport: fix 32-bit quota test failures
Theodore Ts'o [Sun, 13 Aug 2017 18:45:27 +0000 (14:45 -0400)] 
libsupport: fix 32-bit quota test failures

On 32-bit platform some of the util_dqblk structures have a type of
long long.  So we need to use %lld and casts to make sure the right
thing happens on both 32-bit and 64-bit platforms.

Fixes: 968c1c2fe472ddc4a467aaff71305e83cdb0308f
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoMerge branch 'maint' into next
Theodore Ts'o [Fri, 4 Aug 2017 16:30:01 +0000 (12:30 -0400)] 
Merge branch 'maint' into next

6 years agoUpdate release notes, etc., for the 1.43.5 release v1.43.5
Theodore Ts'o [Fri, 4 Aug 2017 16:20:53 +0000 (12:20 -0400)] 
Update release notes, etc., for the 1.43.5 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoAdd new symbol to debian/e2fslibs.symbols
Theodore Ts'o [Fri, 4 Aug 2017 16:19:47 +0000 (12:19 -0400)] 
Add new symbol to debian/e2fslibs.symbols

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agodebian: update policy conformance to standards version 4.0
Theodore Ts'o [Fri, 4 Aug 2017 15:27:15 +0000 (11:27 -0400)] 
debian: update policy conformance to standards version 4.0

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agodebian/rules: update config.{guess,sub} before running configure, not after
Theodore Ts'o [Fri, 4 Aug 2017 15:26:39 +0000 (11:26 -0400)] 
debian/rules: update config.{guess,sub} before running configure, not after

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoRemove special mips libraries from Debian build
Theodore Ts'o [Fri, 4 Aug 2017 06:01:43 +0000 (02:01 -0400)] 
Remove special mips libraries from Debian build

These libraries were needed to support arcboot, which is obsolete and
no longer part of Debian.  So drop these non-standard, legacy special
libraries that were only built on the mips platform.

Addresses-Debian-Bug: #864144

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoRemove obsolete Conflicts/Replaces headers in Debian control file
Theodore Ts'o [Fri, 4 Aug 2017 05:54:55 +0000 (01:54 -0400)] 
Remove obsolete Conflicts/Replaces headers in Debian control file

Addresses-Debian-Bug: #866623

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoRemove spaces at the end of man pages
Theodore Ts'o [Fri, 4 Aug 2017 05:51:50 +0000 (01:51 -0400)] 
Remove spaces at the end of man pages

Addresses-Debian-Bug: #865584

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoClarify description of the the commit mount option in the ext4 man page
Theodore Ts'o [Fri, 4 Aug 2017 05:47:29 +0000 (01:47 -0400)] 
Clarify description of the the commit mount option in the ext4 man page

Addresses-Debian-Bug: #867895

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoUpdate translation template for 1.43.5 release
Theodore Ts'o [Fri, 4 Aug 2017 05:30:54 +0000 (01:30 -0400)] 
Update translation template for 1.43.5 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoUpdate lib/e2p/Makefile.in using "make depend"
Theodore Ts'o [Fri, 4 Aug 2017 05:27:48 +0000 (01:27 -0400)] 
Update lib/e2p/Makefile.in using "make depend"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agopo: update vi.po (from translationproject.org)
Trần Ngọc Quân [Fri, 4 Aug 2017 05:08:46 +0000 (01:08 -0400)] 
po: update vi.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agopo: update sr.po (from translationproject.org)
Мирослав Николић [Fri, 4 Aug 2017 05:08:46 +0000 (01:08 -0400)] 
po: update sr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agopo: update hu.po (from translationproject.org)
Balázs Úr [Fri, 4 Aug 2017 05:08:46 +0000 (01:08 -0400)] 
po: update hu.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agopo: update da.po (from translationproject.org)
Joe Hansen [Fri, 4 Aug 2017 05:08:46 +0000 (01:08 -0400)] 
po: update da.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Fri, 4 Aug 2017 05:08:46 +0000 (01:08 -0400)] 
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoe2fsck: fix e2fsck -D for encrypted directories
Theodore Ts'o [Tue, 1 Aug 2017 14:26:11 +0000 (10:26 -0400)] 
e2fsck: fix e2fsck -D for encrypted directories

If the directory entry is encrypted there may be embedded NUL
characters; hence, we should use memcmp instead of strncmp when
comparing strings.  Otherwise, e2fsck can erroneously report that a
directory have duplicant entries when doing an e2fsck -D check.

Reported-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoMerge branch 'maint' into next
Theodore Ts'o [Fri, 28 Jul 2017 00:07:22 +0000 (20:07 -0400)] 
Merge branch 'maint' into next

6 years agoFix build when configured with --disable-threads
Theodore Ts'o [Thu, 27 Jul 2017 23:43:00 +0000 (19:43 -0400)] 
Fix build when configured with --disable-threads

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoFix build when configured with --enable-profile
Theodore Ts'o [Thu, 27 Jul 2017 23:42:23 +0000 (19:42 -0400)] 
Fix build when configured with --enable-profile

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: fix error handling for ext2fs_sync_device()
Theodore Ts'o [Thu, 27 Jul 2017 23:41:22 +0000 (19:41 -0400)] 
libext2fs: fix error handling for ext2fs_sync_device()

Return the proper error code instead of -1.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoFurther cleanups of the dir_link documentation in the ext4 man page
Theodore Ts'o [Thu, 27 Jul 2017 22:31:04 +0000 (18:31 -0400)] 
Further cleanups of the dir_link documentation in the ext4 man page

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibsupport: fix error handling in quota_write_inode
zhangyi (F) [Mon, 24 Jul 2017 07:01:26 +0000 (15:01 +0800)] 
libsupport: fix error handling in quota_write_inode

The error return value of quota_file_create() is no longer < 0,
and the error handling in quota_write_inode() is incorrect,
fix these. This also fix a tune2fs segfault that currently
occurs when we add project and quota features to an inode
exhaustion ext4 filesystem.

Fixes: a701823a3150("libsupport: fix gcc -Wall nits")
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agodebugfs: fix "ls -p" to avoid printing garbage after the file name
Theodore Ts'o [Mon, 24 Jul 2017 17:11:16 +0000 (13:11 -0400)] 
debugfs: fix "ls -p" to avoid printing garbage after the file name

In commit 68a1de3df3 (debugfs: pretty print encrypted filenames in the
ls command), a change was introduced in debugfs/ls.c which instead of
copying dirent->name and 0-terminating it, dirent->name is used
directly in printf.

However, instead of using the precision to limit the number of
characters output, the code uses the field width. As a result,
characters are output until a 0 is read, which results in garbage
after the file name.

Also fix two other instances of this in debugging messages that aren't
used, but fixing them will avoid potential future copypasta bugs.

Reported-by: Christian Gabriel <ch_gabriel@web.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoe2fsck: eliminate bad update link count attempt
Tahsin Erdogan [Mon, 24 Jul 2017 04:11:30 +0000 (00:11 -0400)] 
e2fsck: eliminate bad update link count attempt

Extended attribute inodes have a link count of 1 but they are not
attached to any directories. When an xattr inode with zero ea
references is found, the remedy is to reconnect it to lost+found dir.
Since reconnect operation increments the link count, it would normally
become 2 but to avoid that, check_ea_inode() sets the link count to
zero in anticipation of reconnect operation. And it does it even when
e2fsck is invoked with -n option which causes a fatal e2fsck failure
as can be demonstrated with the following test script:

  mke2fs -b 4096 -I 256 -F -O extent,ea_inode /dev/sdb 1G
  mount /dev/sdb /mnt/sdb
  touch /mnt/sdb/x
  setfattr -n user.ie1 -v $(python -c "print 'v'*5000") /mnt/sdb/x
  umount /dev/sdb
  debugfs -w -R 'rm x' /dev/sdb
  e2fsck -f -n /dev/sdb

In this case, e2fsck fails with the following error:

  e2fsck 1.43.5-WIP (17-Feb-2017)
  Pass 1: Checking inodes, blocks, and sizes
  Pass 2: Checking directory structure
  Pass 3: Checking directory connectivity
  Pass 4: Checking reference counts
  ext2fs_write_inode: Attempt to write to filesystem opened read-only
  while writing inode 13 in check_ea_inode
  e2fsck: aborted

Setting link count to zero is not really required because e2fsck will
detect the discrepancy in link count and offer to fix it.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoresize2fs: add support for resizing filesystems with ea_inode feature
Tahsin Erdogan [Mon, 24 Jul 2017 03:42:43 +0000 (23:42 -0400)] 
resize2fs: add support for resizing filesystems with ea_inode feature

Resizing filesystems with ea_inode feature was disallowed so far
because the code for updating the ea entries was missing. This patch
adds that support.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: add ea_inode support to set xattr
Tahsin Erdogan [Mon, 24 Jul 2017 02:54:58 +0000 (22:54 -0400)] 
libext2fs: add ea_inode support to set xattr

This patch is a major update to how we decide where to put extended
attributes.  The main motivation is to enable creating values in
extended attribute inodes.  While doing this, we want to implement a
behavior that is as close to kernel as possible.

Existing set ea code deviates from kernel behavior which makes it harder
to implement ea_inode feature:

 - kernel only sorts ea entries in xattr block, e2fsprogs implementation
   sorts all entries on every update.

 - e2fsprogs implementation shuffled things on every update so the order
   of updates does not matter. Kernel does not reshuffle things.

 - e2fsprogs could evacuate entries from inode body to xattr block and
   vice versa. This behavior does not exist in kernel.

Such differences could lead to inconsistent behavior between fuse2fs and
a kernel mount.

With ea_inode feature, we also need to decide whether to put a value
in an inode or keep it 'inline'.  In kernel implementation this
depends on current placement of entries.

To close the behavioral gap, ext2fs_xattr_set() now takes over the
decision about where to place ea values.  This also allows it to raise
errors early instead of delaying them to a separate
ext2fs_xattrs_write() call later.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: eliminate empty element holes in ext2_xattr_handle->attrs
Tahsin Erdogan [Mon, 24 Jul 2017 02:47:05 +0000 (22:47 -0400)] 
libext2fs: eliminate empty element holes in ext2_xattr_handle->attrs

When an extended attribute is removed, its array element is emptied.
This creates holes in the array so various places that want to walk
filled elements have to do an empty element check.

Have remove operation shift remaining filled elements to the left.
This allows a simple iteration up to ext2_xattr_handle->count to walk
all filled entries, and so empty element checks become unnecessary.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: rename ext2_xattr_handle->length to capacity
Tahsin Erdogan [Mon, 24 Jul 2017 01:25:32 +0000 (21:25 -0400)] 
libext2fs: rename ext2_xattr_handle->length to capacity

ext2_xattr_handle has two fields 'count' and 'length' which
represent number of filled elements vs total element count.
They have close meanings so are easy to confuse, thus make code less
readable. Rename length to capacity.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoe2fsck: update quota inode accounting for ea_inode feature
Tahsin Erdogan [Mon, 24 Jul 2017 01:20:41 +0000 (21:20 -0400)] 
e2fsck: update quota inode accounting for ea_inode feature

Extended attribute inodes are charged to all referencing inodes.
Update e2fsck so that it can correctly track inode quota charges.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoClarify how the description of the dir_nlink feature in the ext4 man page
Theodore Ts'o [Sun, 23 Jul 2017 22:51:22 +0000 (18:51 -0400)] 
Clarify how the description of the dir_nlink feature in the ext4 man page

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agotune2fs: edit dire warning about check intervals
Eric Sandeen [Sun, 23 Jul 2017 22:34:57 +0000 (18:34 -0400)] 
tune2fs: edit dire warning about check intervals

Time & mount-count based checks have been off by default for quite some
time now, but the dire warning about disabling them remains in the
tune2fs manpage, which is confusing.  We did "strongly consider
the consequences" and disabled it by default, no need to scare the
user about it now.  Inform the user of the consequences in a more
measured tone.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoresize2fs: sanity check the free blocks and inode counts
Theodore Ts'o [Sun, 23 Jul 2017 04:46:36 +0000 (00:46 -0400)] 
resize2fs: sanity check the free blocks and inode counts

If the free block or free inodes count are larger than the number of
blocks or inodes in the system, request that the file system be
checked.  Otherwise it's possible for calcuate_minimum_resize_size()
to hang in an infinite loop.

This problem was found using American Fuzzy Lop.

Reported-by: Adam Buchbinder <abuchbinder@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agodebugfs: add sanity checking to the string_to_inode() utility function
Theodore Ts'o [Sun, 23 Jul 2017 04:45:05 +0000 (00:45 -0400)] 
debugfs: add sanity checking to the string_to_inode() utility function

Otherwise it's possible for a corrupt file system or bad user input to
cause debugfs to crash if the resulting inode number is insanely
large.

This problem was found using American Fuzzy Lop.

Reported-by: Adam Buchbinder <abuchbinder@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agolibext2fs: add stricter checks on the inode size in ext2fs_open2()
Theodore Ts'o [Sun, 23 Jul 2017 04:26:44 +0000 (00:26 -0400)] 
libext2fs: add stricter checks on the inode size in ext2fs_open2()

An inode size larger than the block size can cause userspace programs
to crash.

This problem was found using American Fuzzy Lop.

Reported-by: Adam Buchbinder <abuchbinder@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>