Whamcloud - gitweb
tools/e2fsprogs.git
10 years agotests: add checks for journal checksum feature
Andreas Dilger [Fri, 13 Apr 2012 07:50:29 +0000 (01:50 -0600)]
tests: add checks for journal checksum feature

f_jchksum_bblk: journal checksum feature where there is a corrupt
block in an uncommitted transaction
f_jchksum_blast_trans: incomplete last trans not considered bad
f_jchksum_remount: check journal mounted by a kernel without
CHECKSUM support after CHECKSUM is in journal superblock

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agotests: create random filesystem, corrupt, e2fsck
Andreas Dilger [Fri, 13 Apr 2012 07:53:39 +0000 (01:53 -0600)]
tests: create random filesystem, corrupt, e2fsck

The f_random_corruption test enables a random subset of filesystem
features, picks one of the valid filesystem block and inode sizes,
and a random device size and creates a new filesystem with those
parameters.

It is possible to disable the running of the test by setting the
environment variable F_RANDOM_CORRUPTION=skip.  By default the test
script is run only one time, but setting the LOOP_COUNT variable
allows the test to run multiple times.

The resulting filesystem is corrupted with both random data and
by shifting data from one part of the device to another and then
repaired by e2fsck.  In some rare cases the random corruption is
severe enough that the filesystem is not recoverable (e.g. small
filesystem with no backup superblock has bad superblock corruption)
but in most cases "e2fsck -fy" should be able to fix all errors
in some way.

A second e2fsck run is done to verify that all of the errors are
fixed in the first pass, and that the filesystem is free of errors.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agotests: add test cases for inode badness
Andreas Dilger [Fri, 13 Apr 2012 07:23:17 +0000 (01:23 -0600)]
tests: add test cases for inode badness

Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agoe2fsck: track errors/badness found for each inode
Andreas Dilger [Fri, 13 Apr 2012 07:13:58 +0000 (01:13 -0600)]
e2fsck: track errors/badness found for each inode

The present e2fsck code checks the inode, per field basis.  It
doesn't take into consideration to total sanity of the inode.
This may cause e2fsck turning a garbage inode into an apparently
sane inode ("It is a vessel of fertilizer, and none may abide
its strength.").

The following patch adds a heuristics to detect the degree of
badness of an inode. icount mechanism is used to keep track of
the badness of every inode.  The badness is increased as various
fields in inode are found to be corrupt.  Badness above a certain
threshold value results in deletion of the inode.  The default
badness threshold value is 7, it can be specified to e2fsck
using "-E inode_badness_threshold=<value>"

This can avoid lengthy pass1b shared block processing, where a
corrupt chunk of the inode table has resulted in a bunch of
garbage inodes suddenly having shared blocks with a lot of good
inodes (or each other).

Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agotests: add tests for expanding inode extra size
Andreas Dilger [Fri, 13 Apr 2012 00:05:03 +0000 (18:05 -0600)]
tests: add tests for expanding inode extra size

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agoe2fsck: add support for expanding the inode size
Andreas Dilger [Fri, 13 Apr 2012 00:03:37 +0000 (18:03 -0600)]
e2fsck: add support for expanding the inode size

This patch adds a "-E expand_extra_isize" feature which makes sure
that _every_ used inode has i_extra_isize >= s_min_extra_isize if
s_min_extra_isize is set. Else it makes sure that i_extra_isize
of every inode is equal to sizeof(ext2_inode_large) - 128.

This is useful for the case where nanosecond timestamps or 64-bit
inode version fields are required for all inodes in the filesystem.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agoe2fsck: ignore xattr feature in backup superblocks
Andreas Dilger [Fri, 13 Apr 2012 18:25:25 +0000 (12:25 -0600)]
e2fsck: ignore xattr feature in backup superblocks

Since the xattr feature is enabled automatically by the kernel,
it can cause spurious e2fsck runs on a clean filesystem due to
differences between the primary and backup superblocks.

Signed-off-by: Eric Sandeen <esandeen@redhat.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agotests: PAGE_SIZE larger than blocksize with hole
Andreas Dilger [Thu, 9 Aug 2012 05:23:22 +0000 (23:23 -0600)]
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().

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agoe2fsck: handle preallocation for large PAGE_SIZE
Andreas Dilger [Fri, 13 Apr 2012 07:59:31 +0000 (01:59 -0600)]
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>
10 years agotests: add tests for uninitialized bitmaps
Andreas Dilger [Thu, 12 Apr 2012 23:52:44 +0000 (17:52 -0600)]
tests: add tests for uninitialized bitmaps

Various tests for handing uninitialized block and inode bitmaps,
and inodes beyond the in-use high watermark.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agotune2fs: warn if the filesystem journal is dirty
Andreas Dilger [Thu, 12 Apr 2012 23:38:13 +0000 (17:38 -0600)]
tune2fs: warn if the filesystem journal is dirty

Running tune2fs on a filesystem with an unrecovered journal can
cause the tune2fs settings to be reverted when the journal is
replayed.  Print a warning if this is detected so that the user
isn't surprised if it happens.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agoe2fsck: allow deleting or zeroing shared blocks
Andreas Dilger [Thu, 12 Apr 2012 23:32:53 +0000 (17:32 -0600)]
e2fsck: allow deleting or zeroing shared blocks

E2fsck fixes files that are found to be sharing blocks by cloning
the shared blocks and giving each file a private copy in pass 1D.

Allowing all files claiming the shared blocks to have copies can
inadvertantly bypass access restrictions.  Deleting all the files,
zeroing the cloned blocks, or placing the files in the /lost+found
directory after cloning may be preferable in some secure environments.

The following patches implement config file and command line options
in e2fsck that allow pass 1D behavior to be tuned according to site
policy.  It adds two extended options and config file counterparts.
On the command line:

 -E clone=dup|zero

    Select the block cloning method.  "dup" is old behavior,
    and is the default.  "zero" is a new method that substitutes
    zero-filled blocks for the shared blocks in all the files
    that claim them.

 -E shared=preserve|lost+found|delete

    Select the disposition of files containing shared blocks.
    "preserve" is the old behavior which remains the default.
    "lost+found" causes files to be unlinked after cloning so
    they will be reconnected to /lost+found in pass 3.
    "delete" skips cloning entirely and simply deletes the files.

In the config file:
  [options]
      clone=dup|zero
      shared=preserve|lost+found|delete

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agoe2fsck: parse config file before command-line opts
Andreas Dilger [Thu, 12 Apr 2012 23:24:55 +0000 (17:24 -0600)]
e2fsck: parse config file before command-line opts

The patch changes the order that the config file and command line
are parsed so that command line has precedence.  It also parses
the -E option for every occurrence, otherwise the -E option is
not cumulative.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agotests: invalid value of in-inode EA offset
Andreas Dilger [Thu, 12 Apr 2012 22:57:40 +0000 (16:57 -0600)]
tests: invalid value of in-inode EA offset

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agotests: extent pointing to non-existent block
Andreas Dilger [Fri, 25 May 2012 07:01:28 +0000 (01:01 -0600)]
tests: extent pointing to non-existent block

Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agoe2fsck: workaround for old extents tests
Andreas Dilger [Thu, 12 Apr 2012 22:15:07 +0000 (16:15 -0600)]
e2fsck: workaround for old extents tests

The e2fsck_ext2fs_extent_get() part of this patch is a workaround
to handle problems with old Lustre extents patches that didn't
clear the ee_start_hi or ei_leaf_hi fields.

That has been fixed for long time and could be removed as soon
as the f_extent_* tests are fixed to clear these _hi fields.
Otherwise the extents are all marked as corrupt and it ruins those
tests value.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agotests: verify > 65000 subdirectories
Andreas Dilger [Thu, 12 Apr 2012 22:02:12 +0000 (16:02 -0600)]
tests: verify > 65000 subdirectories

Add test case to verify nlink handling of large directories.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agoTT-177 build: add .spec file for SLES11 packaging
Andreas Dilger [Fri, 13 Apr 2012 08:23:12 +0000 (02:23 -0600)]
TT-177 build: add .spec file for SLES11 packaging

Include the upstream SLES11 .spec file to ensure the packages we
build match the upstream packages.  Any later patches that change
the packaging should patch the .spec file appropriately.

Add in the SLES-specific patches, excluding the replacement de.po
file, since the original SLES11 de.po file is only against 1.41.4,
and is missing a large number of changes to the translated messages
related to 64-bit format specifiers.

  LU-4284 build: add missing Provides line in SLES spec file

  Need to add a line in the SUSE spec file for Provides: ldiskfsprogs.
  This is present in the RHEL spec file and is needed to resolve
  dependencies in lustre server rpms at rpm install time.

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
  Change-Id: Ib4821004d27c9a7271ffdbd7403990e586d6c9ca

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I783d58bd78d7c4c66cc85ec5557ae1aaf64016ba

10 years agobuild: add RHEL6 .spec file for packaging
Andreas Dilger [Fri, 13 Apr 2012 08:19:19 +0000 (02:19 -0600)]
build: add RHEL6 .spec file for packaging

Include the upstream RHEL6 .spec file to ensure the packages we
build match the upstream packages.  Any later patches that change
the packaging should patch the .spec file appropriately.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agobuild: update e2fsprogs.spec for distro builds
Andreas Dilger [Thu, 12 Apr 2012 21:39:04 +0000 (15:39 -0600)]
build: update e2fsprogs.spec for distro builds

Add the distro version to the RPM release number, so that it the
RPM names do not conflict.

Allow the RPM built from upstream to replace the split packages
provided by the distros.  At some point in the future it may be
desirable to also split the RPM built by this spec file, but this
bs complicated by the fact that SLES and RHEL have different splits.

Signed-off-by: Girish Shilamkar <girish.shilamkar@sun.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agofilefrag: Lustre changes to filefrag FIEMAP handling
Andreas Dilger [Thu, 12 Apr 2012 21:31:35 +0000 (15:31 -0600)]
filefrag: Lustre changes to filefrag FIEMAP handling

Add support for multiple-device filesystems by defining a new
fe_device field in the fiemap_extent structure.  This allows
printing the filesystem-relative or linux block device number
associated with each extent of a file.  If a single filesystem
extent is mirrored to multiple block devices, the fe_device
field can be used to disambiguate the multiple copies.

If the "-l" (device-logical) option is given to filefrag, then
all extents for a particular device of a file are returned
before returning extents for the next device.  This makes it
easier to see if extent allocation within a single device is
contiguous, instead of returning all of the blocks of a file
interleaved in file-logical-offset order.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agoblkid: fix ZFS device detection
Andreas Dilger [Thu, 12 Apr 2012 21:26:49 +0000 (15:26 -0600)]
blkid: fix ZFS device detection

Fix the ZFS device detection by looking at multiple uberblocks to
see if any are present, rather than looking for the ZFS boot block
which is not always present.

There may be up to 128 uberblocks, but the first 4 are not written
to disk on a newly-formatted filesystem so check several of them at
different offsets within the uberblock array.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agoe2fsck: improve in-inode xattr checks
Andreas Dilger [Thu, 12 Apr 2012 21:23:47 +0000 (15:23 -0600)]
e2fsck: improve in-inode xattr checks

Add check for in-inode xattr to make sure that it is not referencing
an offset that is beyond the end of the inode.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agotests: make generated test scripts read-only
Andreas Dilger [Wed, 23 May 2012 21:05:21 +0000 (15:05 -0600)]
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.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agobuild: update version for Lustre build
Andreas Dilger [Thu, 12 Apr 2012 20:00:07 +0000 (14:00 -0600)]
build: update version for Lustre build

Add Lustre-specific build version to distinguish packages from
upstream packages.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
10 years agolib/ext2fs: Only build tst_libext2fs for make check
Theodore Ts'o [Thu, 10 Jul 2014 20:26:14 +0000 (16:26 -0400)]
lib/ext2fs: Only build tst_libext2fs for make check

It's only necessary to build tst_libext2fs when running "make check".

Also make sure the links of the tst_* programs are done with
$(ALL_LDFLAGS).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoUse sys/syscall.h instead of syscall.h
Theodore Ts'o [Thu, 10 Jul 2014 19:54:42 +0000 (15:54 -0400)]
Use sys/syscall.h instead of syscall.h

Most systems have a backwards compatibility symlink in
/usr/include/syscall.h to /usr/include/sys/syscall.h, but
sys/syscall.h is the documented location of the header file.  Fix two
locations where we were using <syscall.h> instead of <sys/syscall.h>.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agomke2fs: fix fencepost error when calling strncat
Theodore Ts'o [Thu, 10 Jul 2014 19:33:57 +0000 (15:33 -0400)]
mke2fs: fix fencepost error when calling strncat

There were other protections which would prevent a buffer overflow
from happening, but we should fix this nevertheless.

Addresses-Coverity-Bug: #1225003
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoUpdate release notes, etc. for final 1.42.11 release v1.42.11
Theodore Ts'o [Thu, 10 Jul 2014 03:44:51 +0000 (23:44 -0400)]
Update release notes, etc. for final 1.42.11 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoFix nroff macro issue in chattr man page
Theodore Ts'o [Thu, 10 Jul 2014 04:47:40 +0000 (00:47 -0400)]
Fix nroff macro issue in chattr man page

The single quote character must not be in the first character in a
line, or else it can get mistaken as a macro call.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoFix up configure so it finds mkinstalldirs
Theodore Ts'o [Thu, 10 Jul 2014 04:17:05 +0000 (00:17 -0400)]
Fix up configure so it finds mkinstalldirs

As an object lesson in why autoreconf is fundamentally unsafe, the
newer version of nls.m4 no longer handles @MKINSTALLDIRS@.  So add
this back, since our Makefiles depend on it.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoUpdate translation files
Theodore Ts'o [Thu, 10 Jul 2014 03:30:49 +0000 (23:30 -0400)]
Update translation files

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update vi.po (from translationproject.org)
Trần Ngọc Quân [Thu, 10 Jul 2014 03:13:31 +0000 (23:13 -0400)]
po: update vi.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Thu, 10 Jul 2014 03:13:31 +0000 (23:13 -0400)]
po: update uk.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Thu, 10 Jul 2014 03:13:31 +0000 (23:13 -0400)]
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Thu, 10 Jul 2014 03:13:31 +0000 (23:13 -0400)]
po: update nl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update es.po (from translationproject.org)
Benno Schulenberg [Thu, 10 Jul 2014 03:13:30 +0000 (23:13 -0400)]
po: update es.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update eo.po (from translationproject.org)
Benno Schulenberg [Thu, 10 Jul 2014 03:13:30 +0000 (23:13 -0400)]
po: update eo.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Thu, 10 Jul 2014 03:13:30 +0000 (23:13 -0400)]
po: update de.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Thu, 10 Jul 2014 03:13:30 +0000 (23:13 -0400)]
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agomke2fs: add support to align hugefiles relative to beginning of the disk
Theodore Ts'o [Wed, 9 Jul 2014 00:02:48 +0000 (20:02 -0400)]
mke2fs: add support to align hugefiles relative to beginning of the disk

Add the mke2fs.conf configuration option which causes the hugefiles to
be aligned to the beginning of the disk.  This is important if the the
reason for aligning the hugefiles is to support hard-drive specific
features such as Shingled Magnetic Recording (SMR).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoUpdate translation files for upcoming 1.42.11 release
Theodore Ts'o [Sun, 6 Jul 2014 03:44:28 +0000 (23:44 -0400)]
Update translation files for upcoming 1.42.11 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: add Esperanto translation
Benno Schulenberg [Sun, 6 Jul 2014 03:39:54 +0000 (23:39 -0400)]
po: add Esperanto translation

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: add Ukrainian translation
Yuri Chornoivan [Sun, 6 Jul 2014 03:31:42 +0000 (23:31 -0400)]
po: add Ukrainian translation

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update vi.po (from translationproject.org)
Trần Ngọc Quân [Sun, 6 Jul 2014 03:18:05 +0000 (23:18 -0400)]
po: update vi.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Sun, 6 Jul 2014 03:18:05 +0000 (23:18 -0400)]
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Sun, 6 Jul 2014 03:18:05 +0000 (23:18 -0400)]
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Sun, 6 Jul 2014 03:18:05 +0000 (23:18 -0400)]
po: update nl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update it.po (from translationproject.org)
Milo Casagrande [Sun, 6 Jul 2014 03:18:04 +0000 (23:18 -0400)]
po: update it.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update fr.po (from translationproject.org)
Samuel Thibault [Sun, 6 Jul 2014 03:18:04 +0000 (23:18 -0400)]
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Sun, 6 Jul 2014 03:18:04 +0000 (23:18 -0400)]
po: update de.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Sun, 6 Jul 2014 03:18:04 +0000 (23:18 -0400)]
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoe2fsck: reopen the file system with saved flags after a journal replay
Theodore Ts'o [Sun, 6 Jul 2014 02:53:29 +0000 (22:53 -0400)]
e2fsck: reopen the file system with saved flags after a journal replay

After a journal replay, we close and reopen the file system so that
any changes in the superblock can get reflected in the libext2fs's
internal data structures.  We need to save the flags passed to
ext2fs_open() that we used when we originally opened the file system.

Otherwise we will end up not be able to repair a file system which
requires a journal replay and which has bigalloc enabled or which has
more than 2**32 blocks; e2fsck will abort with the error message:

fsck.ext4: Filesystem too large to use legacy bitmaps while trying to re-open

Addresses-Debian-Bug: 744953
Cc: Андрей Василишин <a.vasilishin@kpi.ua>
Cc: Jon Severinsson <jon@severinsson.net>
Cc: 744953@bugs.debian.org
10 years agomke2fs: prevent creation of unmountable ext4 with large flex_bg count
Akira Fujita [Sun, 6 Jul 2014 02:42:36 +0000 (22:42 -0400)]
mke2fs: prevent creation of unmountable ext4 with large flex_bg count

In mke2fs command, if flex_bg count is too large to filesystem blocks
count, unmountable ext4 which has the out of filesystem block offset
is created (Case1).  Moreover this large flex_bg count causes an
unintentional metadata layout (bmap-imap-itable-bmap-imap-itable .. in
block group) (Case2).

To fix these issues and keep healthy flex_bg layout, disallow creating
ext4 with obviously large flex_bg count to filesystem blocks count.

Steps to reproduce:
(Case1)
1.
    # mke2fs -t ext4 -b 4096 -O ^resize_inode -G $((2**20)) DEV 2130483

2.
    # mount -t ext4 DEV MP
    mount: wrong fs type, bad option, bad superblock on /dev/sdb4,
           missing codepage or helper program, or other error
           In some cases useful info is found in syslog - try
           dmesg | tail  or so

3.
    # dumpe2fs DEV
    ...
    Block count:              2130483
    ...
    Flex block group size:    1048576
    ...
    Group 65: (Blocks 2129920-2130482) [INODE_UNINIT]
      Checksum 0x4cb3, unused inodes 8080
      Block bitmap at 67 (bg #0 + 67), Inode bitmap at 1048643 (bg #32 + 67)
      Inode table at 2129979-2130483 (+59)
                             ^^^^^^^  2130483 is out of FS!
      65535 free blocks, 8080 free inodes, 0 directories, 8080 unused inodes
      Free blocks:
      Free inodes: 525201-533280

(Case2)
1.
    # mke2fs -t ext4 -G 2147483648 DEV 3145728

2.
    # debugfs -R stats DEV
    ...
    Block count:              786432
    ...
    Flex block group size:    2147483648
    ...
     Group  0: block bitmap at 193, inode bitmap at 194, inode table at 195
    ...
     Group  1: block bitmap at 707, inode bitmap at 708, inode table at 709
    ...
     Group  2: block bitmap at 1221, inode bitmap at 1222, inode table at 1223
    ...

Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
10 years agomke2fs: add get_uint_from_profile to mke2fs.c
Akira Fujita [Sun, 6 Jul 2014 02:34:07 +0000 (22:34 -0400)]
mke2fs: add get_uint_from_profile to mke2fs.c

We can set flex_bg count only up to 2^30 with profile
because get_int_from_profile can handle it to 2^31-1.
Add get_uint_from_profile to read unsigned int value
so that mke2fs with profile can handle up to 2^31 flex_bg same as -G option.

Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agomke2fs: set upper limit to flex_bg count
Akira Fujita [Sun, 6 Jul 2014 02:14:08 +0000 (22:14 -0400)]
mke2fs: set upper limit to flex_bg count

mke2fs -G option allows root user to set flex_bg count (power of 2).
However ext4 has bad metadata layout if we specify more than or equal to
2^32 to mke2fs -G, because of the 32bit shift operation
in ext2fs_allocate_group_table().

And the maximum block group count of ext4 is 2^32 -1 (ext4_group_t
s_groups_count), so diallow more than 2^32 flex_bg count.

Steps to reproduce:

   # mke2fs -t ext4 -G 4294967296 DEV

   # dumpe2fs DEV
   ...
   Flex block group size:    1          <----- flex_bg is 1!
   ...
   Group 0: (Blocks 0-32767)
     Checksum 0x4afd, unused inodes 7541
     Primary superblock at 0, Group descriptors at 1-1
     Reserved GDT blocks at 2-59
     Block bitmap at 60 (+60), Inode bitmap at 61 (+61)
     Inode table at 62-533 (+62)
     32228 free blocks, 7541 free inodes, 2 directories, 7541 unused inodes
     Free blocks: 540-32767
     Free inodes: 12-7552
   Group 1: (Blocks 32768-65535) [INODE_UNINIT]
     Checksum 0xc890, unused inodes 7552
     Backup superblock at 32768, Group descriptors at 32769-32769
     Reserved GDT blocks at 32770-32827
     Block bitmap at 32828 (+60), Inode bitmap at 32829 (+61)
     Inode table at 32830-33301 (+62)
     32234 free blocks, 7552 free inodes, 0 directories, 7552 unused inodes
     Free blocks: 33302-65535
     Free inodes: 7553-15104
   ...

Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: "Darrick J. Wong" <darrick.wong@oracle.com>
10 years agomke2fs: handle flex_bg collision with backup descriptors
Andreas Dilger [Fri, 28 Feb 2014 20:15:45 +0000 (13:15 -0700)]
mke2fs: handle flex_bg collision with backup descriptors

If a large flex_bg factor is specified and the block allocator was
laying out block or inode bitmaps or inode tables, and collides with
previously allocated metadata (for example the backup superblock or
group descriptors) it would reset the allocator back to the beginning
of the flex_bg instead of continuing past the obstruction.

For example, with "-G 131072" the inode table will hit the backup
descriptors in groups 1, 3, 5, 7, 9 and start interleaving with the
block and inode bitmaps.  That results in poorly allocated bitmaps
and inode tables that are interleaved and not contiguous as was
intended for flex_bg:

 Group 0: (Blocks 0-32767)
   Primary superblock at 0, Group descriptors at 1-2048
   Block bitmap 2049 (+2049), Inode bitmap at 133121 (bg #4+2049)
   Inode table 264193-264200 (bg #8+2049)
   :
   :
 Group 3838: (Blocks 125763584-125796351) [INODE_UNINIT, BLOCK_UNINIT]
   Block bitmap 5887 (bg #0+5887), Inode bitmap 136959 (bg #4+5887)
   Inode table 294897-294904 (bg #8 + 32753)
 Group 3839: (Blocks 125796352-125829119) [INODE_UNINIT, BLOCK_UNINIT]
   Block bitmap 5888 (bg #0+5888), Inode bitmap 136960 (bg #4+5888)
   Inode table 5889-5896 (bg #0 + 5889)
 Group 3840: (Blocks 125829120-125861887) [INODE_UNINIT, BLOCK_UNINIT]
   Block bitmap 5897 (bg #0+5897), Inode bitmap 136961 (bg #4+5889)
   Inode table 5898-5905 (bg #0 + 5898)
   :
   :

Instead, skip the intervening blocks if there aren't too many of them.
That mostly keeps the flex_bg allocations from colliding, though still
not perfect because there is still some overlap with the backups.
This patch addresses the majority of the problem, allowing about 124k
groups to be layed out perfectly, instead of less than 4k groups with
the previous code.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agomke2fs: enable lazy_itable_init on newer kernel by default
Lukas Czerner [Sun, 6 Jul 2014 01:08:34 +0000 (21:08 -0400)]
mke2fs: enable lazy_itable_init on newer kernel by default

Currently is used did not specified lazy_itable_init option we rely on
information from ext4 module exported via sysfs interface. However if
the ext4 module is not loaded it will not be enabled even though kernel
might support it.

With this commit we set the default according to the kernel version,
however we still allow it to be set manually via extended option or be
enabled in case that ext4 module advertise that it supports this
feature.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
10 years agomke2fs: add revision to the is_before_linux_ver()
Lukas Czerner [Sun, 6 Jul 2014 01:07:55 +0000 (21:07 -0400)]
mke2fs: add revision to the is_before_linux_ver()

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoe2fsprogs: introduce ext2fs_close_free() helper
Lukas Czerner [Sun, 6 Jul 2014 01:06:29 +0000 (21:06 -0400)]
e2fsprogs: introduce ext2fs_close_free() helper

Currently there are many uses of ext2fs_close() which might be wrong.
First of all ext2fs_close() does not set the ext2_filsys pointer to NULL
so the caller is responsible for clearing it, however there are some
cases there we do not do it.

Second of all very small number of users of ext2fs_close() actually
check the return value. If there is a problem in ext2fs_close() it will
not even free the ext2_filsys structure, but majority of users expect it
to do so.

To fix both problems this commit introduces a new helper
ext2fs_close_free() which will not only check for the return value and
free the ext2_filsys structure if the call to ext2fs_close2() failed,
but it will also set the ext2_filsys pointer to NULL.

Replace every use of ext2fs_close() in e2fsprogs tools with
ext2fs_close_free() - there is no real reason to keep using
ext2fs_close().

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
10 years agofix cross-compilation support
Theodore Ts'o [Sun, 6 Jul 2014 00:23:23 +0000 (20:23 -0400)]
fix cross-compilation support

Commit 2500ebfc89 (util: fix make dependencies for subst) broke cross
compilation because it unconditionally used config.h without setting a
includes path so that the config.h file could be found.

The proposed fix of adding the include path (such as was proposed at
http://patchwork.ozlabs.org/patch/355662/ or in Debian Bug #753375)
isn't really the right way to go, since the information in config.h is
for the target environment, and not the build environment.  So using
config.h when building helper programs used as part of the build can
potentially cause more problems than it solves.

In general, build helpers must be written to be as portable as
possible, and to not require any autoconf defined #ifdef's whenever
possible.  The subst program broke this rule to (1) address a Coverity
security complaint by using futimes(2) instad of utimes(2) if present,
and (2) to preserve the nanosecond portion of the file timestamp.

Oh, well.  We won't be able to do the latter when cross compiling, and
as to the former, if an attacker has write access to your build tree
while you are building programs that will be run as root, you've got
bigger problems.  :-)

Fix the problem that commit 2500ebfc89 was trying to address by
explicitly adding @DEFS@ to CFLAGS, so that -DHAVE_CONFIG_H is passed
to make depend.  This fixes up the make depend without forcing the use
of config.h when cross-compiling.

Addresses-Debian-Bug: #753375
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Helmut Grohne <helmut@subdivi.de>
Cc: 753375@bugs.debian.org
10 years agoconfigure.in: fix external libblkid test for static link
Theodore Ts'o [Sat, 5 Jul 2014 04:27:02 +0000 (00:27 -0400)]
configure.in: fix external libblkid test for static link

External libblkid needs -luuid when linking statically.

Also fix up the bogus other-lib parameter in the libuuid test;
$LIBUUID is the null string, so it doesn't do anything other than
obfuscate the use of AC_CHECK_LIB.

Reported-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoblkid,ext2fs: avoid name clash with __u{8,16,32,64}
Andreas Dilger [Sat, 5 Jul 2014 03:34:10 +0000 (23:34 -0400)]
blkid,ext2fs: avoid name clash with __u{8,16,32,64}

Try to avoid name clashes with definitions of __u8, __u16, __u32,
and __u64 in userspace, in case other headers also define these
types.  Define HAVE___{S,U}{8,16,32,64} preprocessor macros to
show that these types are already defined.

This would avoid the need to check for _BLKID_TYPES_H in ext2_types.h
and _EXT2_TYPES_H in blkid_types.h, but since older versions of these
headers did not use HAVE___U8 et.al. keep these checks around for now.

Report an error if there are no 64-bit types available.  The code
will not compile if these are not available.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoblkid: remove unnecessary header and comment
Andreas Dilger [Wed, 11 Jun 2014 18:59:05 +0000 (12:59 -0600)]
blkid: remove unnecessary header and comment

The LIST_HEAD macro is not directly used in getsize.c, so
<sys/queue.h> is not needed at all, and could cause confusion at
some later point if the Linux-style list macros are ever used.

Build was verified on MacOS which defined HAVE_SYS_DISK_H true.
I manually inspected the sources for recent *BSD headers to check
if this was needed there or not.  MacOS and FreeBSD <sys/disk.h>
do not use lists at all.  NetBSD and OpenBSD <sys/disk.h> and all
of the <sys/mount.h> headers include <sys/queue.h> internally.

I used http://fxr.watson.org/fxr/source/sys/mount.h?v={OSTYPE}
as a reference, checking both old and new *BSD versions.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoe2fsprogs: add mount options to ext4.5
Eric Sandeen [Sat, 5 Jul 2014 03:07:36 +0000 (23:07 -0400)]
e2fsprogs: add mount options to ext4.5

This is a straight cut and paste from the util-linux
mount manpage to ext4.5 (with commented-out lines
removed).

It's pretty much impossible for util-linux to keep up
with every filesystem out there, and Karel has more than
once expressed a wish that mount options move into fs-specific
manpages.

So, here we go.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoe2fsprogs: revise and extend chattr(1) and chattr usage()
Eric Sandeen [Sat, 5 Jul 2014 03:03:14 +0000 (23:03 -0400)]
e2fsprogs: revise and extend chattr(1) and chattr usage()

The chattr(1) manpage and chattr usage() output were missing some flags.

Add those, and make some other minor cosmetic fixes.

(I've left out the 'B' (EXT2_COMPRBLK_FL) flag, because
it's not actually used anywhere, and I can't figure out
how it differs from 'c' (EXT2_COMPR_FL))

Also, because the matrix of filesystems & flags is quite large,
refer to filesystem-specific manpages for detailed discussion
of flags supported by those filesystems, rather than trying to
cover it all in this manpage.  I'll send those manpage
updates to the appropriate lists a bit later.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
10 years agoe2fsprogs: reorder flags in chattr(1)
Eric Sandeen [Sat, 5 Jul 2014 03:02:59 +0000 (23:02 -0400)]
e2fsprogs: reorder flags in chattr(1)

The flags described in chattr usage() and the chattr(1) manpage
were in semi-random order, which makes it hard to ascertain
which flags might be missing or undocumented, and to locate
flags within the manpage.

Re-order the list of flags in alphanumeric order, and do
the same for the flag descriptions in the body of the manpage.

There should be no content changes here, just reordering
for consistency.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
10 years agoe2fsck: fix last mount time and last write time in preen mode
Jan Kara [Fri, 4 Jul 2014 20:24:18 +0000 (16:24 -0400)]
e2fsck: fix last mount time and last write time in preen mode

Fixing last mount time and last write time is safe - there's no risk of
loosing any important information or making corruption significantly
worse even if we get it wrong. So let's just fix these times in preen
mode. This allows initrd to automatically check and mount root
filesystem in case system clock is wrong without having to manually set
broken_system_clock variable (openSUSE uses broken_system_clock by default
to avoid these problems during boot but this disables time-based checks
even on systems where clock is fine so that's not ideal either).

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agomke2fs: prevent creation of filesystem with unsupported revision
Frank Sorenson [Fri, 4 Jul 2014 19:31:50 +0000 (15:31 -0400)]
mke2fs: prevent creation of filesystem with unsupported revision

It's a bit strange to accept revision levels higher than
the code creating the filesystem can understand, so don't
allow it.

At least the kernel will mount the fs readonly if it's too
high, but no other utility will touch it, so you can't
fix the error.

Just reject anything > EXT2_MAX_SUPP_REV at mkfs time.

Signed-off-by: Frank Sorenson <fsorenso@redhat.com>
[sandeen@redhat.com: Add more verbose commit log]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoe2fsprogs: remove checker infrastructure
Eric Sandeen [Thu, 17 Apr 2014 22:05:38 +0000 (17:05 -0500)]
e2fsprogs: remove checker infrastructure

Per http://www.gnu.org/software/checker/ the gcc "-checker" option
is long deprecated.  Nuke it from e2fsprogs.

Most people would never hit this, but people who love to turn knobs,
such as the reporter of kernel.org bz#74171, might run into it and be
sad.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoUpdate to latest version of config.* files
Theodore Ts'o [Fri, 4 Jul 2014 04:30:04 +0000 (00:30 -0400)]
Update to latest version of config.* files

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agoaclocal.m4: update to newer versions of autoconf macros
Theodore Ts'o [Fri, 4 Jul 2014 03:44:13 +0000 (23:44 -0400)]
aclocal.m4: update to newer versions of autoconf macros

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agomove e2fsprogs-specific macros from aclocal.m4 to acinclude.m4
Ross Burton [Fri, 4 Jul 2014 03:19:38 +0000 (23:19 -0400)]
move e2fsprogs-specific macros from aclocal.m4 to acinclude.m4

Autoconf says that aclocal.m4 is a machine-generated copy of
system-wide macros, whereas acinclude.m4 is for project-specific
macros.  Reflect this division and ease building by anyone who needs
to re-generate the autotooling by splitting AX_TLS and CHECK_GNU_MAKE
to acinclude.m4.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agodebugfs: add support setting the error_count and associated sb fields
Theodore Ts'o [Fri, 4 Jul 2014 02:28:24 +0000 (22:28 -0400)]
debugfs: add support setting the error_count and associated sb fields

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agotests: avoid using mktemp -t
Theodore Ts'o [Fri, 4 Jul 2014 02:16:48 +0000 (22:16 -0400)]
tests: avoid using mktemp -t

The -t option is documented as deprecated in GNU's mktemp, and
FreeBSD's mktemp doesn't support it at all.

Replace it with the construct "mktemp ${TMPDIR:-/tmp}/foo.XXXXXX"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agotests: clean up the temp file if test_one is interrupted
Theodore Ts'o [Mon, 9 Jun 2014 14:47:41 +0000 (10:47 -0400)]
tests: clean up the temp file if test_one is interrupted

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agotests: fix left-over e2fsprogs-tmp files not getting clean up
Theodore Ts'o [Mon, 9 Jun 2014 14:34:17 +0000 (10:34 -0400)]
tests: fix left-over e2fsprogs-tmp files not getting clean up

In addition, incorporate the test name into the e2fsprogs-tmp to make
it easier to debug left-over temp files in the future.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agotests: for mktemp the exes must be the final characters of the name
Benno Schulenberg [Mon, 9 Jun 2014 14:17:39 +0000 (10:17 -0400)]
tests: for mktemp the exes must be the final characters of the name

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 years agomisc: quiet minor build warnings, ignore generated files
Andreas Dilger [Mon, 9 Jun 2014 13:53:40 +0000 (09:53 -0400)]
misc: quiet minor build warnings, ignore generated files

Quiet a couple of build warnings in tst_libext2fs.c
Add missing unistd.h header for misc/util.c.

Ignore generated files for lib/ext2fs/tst_libext2fs and intl/ files.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoresize2fs: don't attempt to calculate minimum size on fs with errors
Eric Sandeen [Mon, 9 Jun 2014 13:52:19 +0000 (09:52 -0400)]
resize2fs: don't attempt to calculate minimum size on fs with errors

My old patch:

resize2fs: don't print minimum size if fs is not clean

almost did this, but it still calculated the size; it just didn't print
it.  Which is a bit silly.

Jes had a pretty badly corrupted image which made the minimum size
calculation go off into the weeds.  It was corrupted, and also marked
as having an error.

We'll eventually bail out for an unmounted filesystem if it's marked
as being in an error state anyway; just move that test & bail-out
to a much earlier point, and remove the now-duplicate one under the
print_min_size block.

This will catch & block all resize operations on an offline filesystem
with errors, in one central place.

Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoe2fsck: sort the abbreviations better
Benno Schulenberg [Wed, 4 Jun 2014 01:59:31 +0000 (21:59 -0400)]
e2fsck: sort the abbreviations better

This makes it easier for translators to look up what they've done.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoe2fsck: make two comments match the messages
Benno Schulenberg [Wed, 4 Jun 2014 01:59:31 +0000 (21:59 -0400)]
e2fsck: make two comments match the messages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoe2fsck: make a prompt message simpler and thus translatable
Benno Schulenberg [Wed, 4 Jun 2014 01:59:31 +0000 (21:59 -0400)]
e2fsck: make a prompt message simpler and thus translatable

It can be made simpler because there is no need to differentiate between
having an internal journal inode and having an external journal device.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agopo: describe more precisely the %B expansion
Benno Schulenberg [Wed, 4 Jun 2014 01:59:31 +0000 (21:59 -0400)]
po: describe more precisely the %B expansion

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agofilefrag: fix issues with 29758d2
Eric Sandeen [Mon, 2 Jun 2014 01:27:41 +0000 (21:27 -0400)]
filefrag: fix issues with 29758d2

29758d2 filefrag: exit with error code if an error is hit

introduced a couple errors; in one case it missed returning
a value, and possibly picked up errno from (unchecked) close(),
and in the other used a test where it needed an
assignment.  So capture the error, move perror() directly
after the failed call in both cases, and fix the assignment.

Also fix a precedence problem with:

if (fe_flags & mask == 0)

which is equivalent to:

if (fe_flags & (mask == 0))

but we need:

if ((fe_flags & mask) == 0)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
11 years agopo: add %It to the list of recognized expansions
Benno Schulenberg [Sun, 1 Jun 2014 21:29:50 +0000 (23:29 +0200)]
po: add %It to the list of recognized expansions

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoe2fsck: fully and properly gettextize two error messages
Benno Schulenberg [Sun, 1 Jun 2014 21:27:49 +0000 (23:27 +0200)]
e2fsck: fully and properly gettextize two error messages

The phrases "mounted" and "in use" were filled in untranslated into
the messages.  But it is better to gettextize entire sentences, and
not synthesize them from fragments.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agomke2fs: fix a typo in an error message
Benno Schulenberg [Mon, 2 Jun 2014 01:12:47 +0000 (21:12 -0400)]
mke2fs: fix a typo in an error message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoFix up minor typo in German translation
Theodore Ts'o [Sat, 31 May 2014 17:37:30 +0000 (13:37 -0400)]
Fix up minor typo in German translation

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: pth@suse.de
11 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Sat, 31 May 2014 17:32:39 +0000 (13:32 -0400)]
po: update de.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agofilefrag: exit with error code if an error is hit
Andreas Dilger [Tue, 27 May 2014 16:56:45 +0000 (12:56 -0400)]
filefrag: exit with error code if an error is hit

If an error is hit during filefrag operation, it will continue to run
(if multiple files are specified on the command-line), but will exit
with a non-zero value, so that callers can determine that some error
was hit.

Clean up the printing of FIEMAP flags and print some newer flags that
were missing.  Also print unknown flags as hex values.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agolib/ext2fs: clean and build ext2_types.h as necessary
Theodore Ts'o [Tue, 27 May 2014 16:24:33 +0000 (12:24 -0400)]
lib/ext2fs: clean and build ext2_types.h as necessary

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agotst_libext2fs: add new debug program which used for libext2fs unit tests
Theodore Ts'o [Fri, 23 May 2014 14:28:04 +0000 (10:28 -0400)]
tst_libext2fs: add new debug program which used for libext2fs unit tests

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agomisc: use unsigned long long for file block count in filefrag
Vitaliy Filippov [Mon, 26 May 2014 16:08:35 +0000 (12:08 -0400)]
misc: use unsigned long long for file block count in filefrag

This patch fixes incorrect reporting of file block count on 32-bit platforms.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoe2fsprogs: don't run quota test if quota is not enabled
Eric Sandeen [Mon, 26 May 2014 15:43:24 +0000 (11:43 -0400)]
e2fsprogs: don't run quota test if quota is not enabled

The default configuration still has quota disabled, but
runs the f_quota test unconditionally, so we fail by
default.

Fix that...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agoe2fsck: fix Makefile dependency for quota.o
Theodore Ts'o [Thu, 22 May 2014 22:52:27 +0000 (18:52 -0400)]
e2fsck: fix Makefile dependency for quota.o

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 years agodebugfs: fix debugfs/quota.c compile warnings
Andreas Dilger [Thu, 22 May 2014 06:38:07 +0000 (00:38 -0600)]
debugfs: fix debugfs/quota.c compile warnings

Fix type mismatch and unused variable warnings.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agodebugfs: fix filehandle leak in copy_file()
Andreas Dilger [Tue, 20 May 2014 22:30:35 +0000 (16:30 -0600)]
debugfs: fix filehandle leak in copy_file()

Fix a file handle leak for the target file in copy_file() when error
handlers return without closing the file.  Instead, clean up at the
end of the function to handle cleanup in normal and error cases.

Minor other code style cleanups.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agodebugfs: fix string_to_time for MacOS strptime()
Andreas Dilger [Tue, 20 May 2014 22:31:10 +0000 (16:31 -0600)]
debugfs: fix string_to_time for MacOS strptime()

The strptime() function does not update fields in struct tm that are
not specified in the input format.  The glibc implementation sets the
tm_yday field (%j) when any of the year (%Y), month (%m), or day (%d)
fields are changed, but the MacOS strptime() does not set tm_yday in
this case.  This caused string_to_time() to calculate the wrong Unix
epoch on MacOS. If tm_yday is unset, compute it in string_to_time().

This also fixes test regression failures for FreeBSD.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 years agomke2fs: use ext2fs_open_file() in check_plausibility()
Eric Sandeen [Wed, 21 May 2014 17:47:44 +0000 (12:47 -0500)]
mke2fs: use ext2fs_open_file() in check_plausibility()

The commit:

802146c mke2fs: create a regular file if necessary

caused a regression on 32-bit machines; the open() fails if
the file size is > 4G.

Using ext2fs_open_file() fixes it.

Addresses-Red-Hat-Bugzilla: #1099892

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>