Commit Graph

4667 Commits (441eb337a8bc7ff7f39bfd1f7fbf9681ce6d2872)

Author SHA1 Message Date
Theodore Ts'o 441eb337a8 util: allow subst to build on systems that do not have utimes()
Make subst more portable so it can deal with such oler systems that do
not have utimes().  Note that it is important that subst build
correctly without an autoconf-generated config.h (since that is what
happens on a cross-compile), as well as using whatever features are
available as determined by autoconf when doing a native build.  We
currently assume the presence of utime(), but not utimes() or
futimes().

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-10-19 22:13:09 -04:00
Eric Whitney 0745e78741 mke2fs: fix man page discussion of usage type defaults
The man page description of the file system size thresholds used by
mke2fs to select a usage type when not otherwise specified by the -T
switch does not match the code.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-10-13 04:19:24 -04:00
Theodore Ts'o deae5e809b resize2fs: fix fs->blocksize dereference after fs has been freed
Commit 77255cf369 introduced a use after free bug.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-10-08 12:09:35 -04:00
Theodore Ts'o ebdf895b43 e2fsck: fix free pointer dereferences
Commit 47fee2ef6a introduces some free pointer dereference bugs by
not clearing ctx->fs after calling ext2fs_close_free().

Reported-by: Matthias Andree <mandree@FreeBSD.org>
Cc: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-10-08 11:18:41 -04:00
Eric Sandeen c6889a6430 e2fsprogs: add large_file to base mkfs features
large_file (> 2G) support has been around since at least kernel 2.4;
mkfs of any sufficiently large filesystem sets it "accidentally"
when the resize inode exceeds 2G.  This leaves very small
filesystems lacking the feature, which potentially changes
their behavior & codepaths the first time a > 2G file gets
written.

There's really no reason to be making fresh filesystems which
strive to keep compatibility with 10 year old kernels; just
enable large_file at mkfs time.  This is particularly obvious
for ext4 fielsystems, which set huge_file by default, but not
necessarily large_file.

If old-kernel compatibility is desired, mke2fs.conf can be
modified locally to remove the feature.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-10-01 08:33:54 -04:00
Theodore Ts'o 17c1fa6e26 misc: fix build breakage with configure --disable-uuidd --enable-profile
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-19 00:26:56 -04:00
Theodore Ts'o e3d10158e6 configure: disable uuidd by default if libuuid is disabled
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-19 00:26:26 -04:00
Theodore Ts'o ceec1709f7 mke2fs: don't depend on <linux/version.h>
Define the KERNEL_VERSION macro explicitly instead of using
<linux/version.h>, since it's not available when using dietlibc.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-19 00:04:24 -04:00
Darrick J. Wong d9112409a2 misc: zero s_jnl_blocks when adding journal online or removing external journal
Erase s_jnl_blocks when removing an external journal, or adding an
internal journal online.  We can't add the backup for the internal
journal because we have no good way to get the indirect block or ETB
addresses, so the best we can do is hope that the user runs e2fsck,
which will correct that.  We are motivated to erase during external
journal removal to state emphatically that there's no journal.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reported-by: thomas_reardon@hotmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-18 21:24:26 -04:00
Theodore Ts'o 5afdf37b56 fix build with configure --disable-uuid --disable-blkid --enable-profile
We need to make sure PROFILED_LIBUUID and PROFILED_LIBBLKID are
defined when we are using the system uuid and blkid libraries.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-18 21:11:33 -04:00
Michael Forney 1419b5ae0b Don't clear BUILD_CFLAGS and BUILD_LDFLAGS when cross-compiling
Signed-off-by: Michael Forney <forney@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-16 12:26:49 -04:00
Theodore Ts'o e426e06afa Merge remote-tracking branch 'origin/maint' into maint 2014-09-11 12:26:27 -04:00
Theodore Ts'o e9a5c6e360 e2fsck: notice when the realloc of dir_info fails
If the reallocation of dir_info fails, we will eventually cause e2fsck
to fail with an internal error.  So if the realloc fails, print a
message and bail out with a fatal error early when at the time of the
reallocation failure.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-11 12:24:07 -04:00
Michael Forney 943e21cda8 compile_et: Allow user to override ET_DIR
Signed-off-by: Michael Forney <forney@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-08 19:02:12 -04:00
Michael Forney 53904ae543 Apply LDFLAGS when building tests
Signed-off-by: Michael Forney <forney@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-08 19:00:24 -04:00
Michael Forney 60abcd7394 tests: Add to LD_LIBRARY_PATH instead of overriding
Signed-off-by: Michael Forney <forney@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-08 18:55:42 -04:00
Theodore Ts'o 8a54677711 debugfs: add better error checking when printing extended attributes
Check to make sure the length of the name and value fields in the
extended attribute don't result in overrun the bounds of the inode.

Addresses-Coverity-Bug: #709517

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-29 14:20:21 -04:00
Theodore Ts'o 6a3741ad29 Update release notes, etc. for final 1.42.12 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-29 09:00:51 -04:00
Trần Ngọc Quân 6de37becb0 po: update vi.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-29 08:46:03 -04:00
Yuri Chornoivan 817844071c po: update uk.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-29 08:46:03 -04:00
Göran Uddeborg 90c5f7ca4e po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-29 08:46:03 -04:00
Jakub Bogusz 5b5fc7f6ad po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-29 08:46:03 -04:00
Benno Schulenberg 8e3bfde840 po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-29 08:46:03 -04:00
Samuel Thibault 482a0eabf9 po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-29 08:46:02 -04:00
Petr Pisar a20457477a po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-29 08:46:02 -04:00
Theodore Ts'o 725502de19 mke2fs: complain if bigalloc and hugefiles_align_disk is incompatible
If the starting partition offset is incompatible with the bigalloc
cluster size, complain and exit, instead of creating a file which
would have a logical to physical block mapping which breaks the
cluster alignment requirement.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-27 09:27:54 -04:00
Theodore Ts'o 3ff57555f6 e2fsprogs.pot: update POT-Creation-Date
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-26 16:34:24 -04:00
Theodore Ts'o a4af7efe54 e2fsck: fix spelling error (strage vs storage)
Reported-by: Philipp Thomas <pth@suse.de>

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-26 09:42:18 -04:00
Eric Sandeen e92beaac10 e2fsprogs: add supported file attributes to ext4.5 manpage
The chattr(1) manpage now refers users to filesystem-specific
manpages for details on supported attributes, so add those to
ext4.5.

I've left out oddities like being able to set the compressed
or no-tail-packing flags, or setting data journaling on ext2.

That behavior seems like a bug, not a feature.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-25 21:02:18 -04:00
Theodore Ts'o 6b319481d9 Interim updates of release notes, etc. in preparation for 1.42.12 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-25 10:30:53 -04:00
Göran Uddeborg a8193af3b2 po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-25 10:05:34 -04:00
Samuel Thibault 4338f0a781 po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-25 10:05:34 -04:00
Antonio Ceballos 6c3c7829b3 po: update es.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-25 10:05:34 -04:00
Petr Pisar 5819e585a8 po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-25 10:05:34 -04:00
Theodore Ts'o ce2e295d7b mke2fs: improve the error message when a non-existent file is specified
If the user does not specify the file system size, and the file does
not exist, give an error message like this:

   The file /tmp/foo.img does not exist and no size was specified.

instead of this:

    Creating regular file /tmp/foo.img
    mke2fs: Device size reported to be zero.  Invalid partition specified, or
	    partition table wasn't reread after running fdisk, due to
	    a modified partition being busy and in use.  You may need to reboot
	    to re-read your partition table.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-24 23:54:37 -04:00
Theodore Ts'o 9ac2930cc9 mke2fs.8.in: explain how the fs-size parameter is interpreted
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-24 23:53:33 -04:00
Theodore Ts'o 77255cf369 resize2fs: clarify the size of blocks in resize2fs's messages
Addresses-Debian-Bug: #758029

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-24 23:23:41 -04:00
Theodore Ts'o 061c566eaa resize2fs.8.in: clarify when on-line resizing is supported
Addresses-Debian-Bug: #726760

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-24 22:40:43 -04:00
Theodore Ts'o 20d6b381a1 dumpe2fs: complain if extra arguments are given on the command line
Addresses-Debian-Bug: #758074

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-24 22:31:03 -04:00
Theodore Ts'o 59a591f6b5 debugfs: fix set_inode_field block[IND|DIND|TIND]
After we determine that we can't parse the array value as an integer,
we need to restore the square brackets to the field name, so that we
can find a match with block[IND], block[DIND], and block[TIND] in the
inode field table.

Reported-by: Jun He <jhe@cs.wisc.edu>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-19 08:27:59 -04:00
Theodore Ts'o c47cd4f287 filefrag: fix extent count calculation when using FIBMAP
The extent count calculation works correctly with the FIBMAP ioctl in
verbose (-v) mode, but without the verbose option, the calculation was
broken because we weren't properly updating the fm_ext data structures
in non-verbose mode.

Addresses-Launchpad-Bug: #1356496

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-13 15:59:20 -04:00
Theodore Ts'o 6197c10c58 tests: convert use of md5sum to crcsum
The following tests were using md5sum: i_e2image, u_mke2fs, and
u_tune2fs.  Convert them to use crcsum for better portability (not all
environments have md5sum; some might have sha1sum instead :-)

For our purposes crcsum is quite sufficient.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-12 14:37:19 -04:00
Darrick J. Wong ab2cd4a4d2 e2fsck: don't flush the FS unless it's actually dirty
ext2fs_flush2() unconditionally writes the block group descriptors to
disk even if the underlying FS isn't marked dirty.  This causes the
following error message on a fsck -n run:

e2fsck 1.43-WIP (09-Jul-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Error writing block 2 (Attempt to write block to filesystem resulted in short write).  Ignore error? no

Error writing block 2 (Attempt to write block to filesystem resulted in short write).  Ignore error? no

Error writing file system info: Attempt to write block to filesystem resulted in short write

Since ext2fs_close2() only calls flush if the dirty flag is set,
modify e2fsck to exhibit the same behavior so that we don't spit out
write errors for a read only check.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-12 14:19:42 -04:00
Theodore Ts'o 115d4b4b33 e2fsck: flush out the superblock and bitmaps before printing final messages
A user who sees the message

***** REBOOT LINUX *****

or

***** FILE SYSTEM WAS MODIFIED *****

might think that e2fsck was complete even though we haven't finished
writing out the superblock or bitmap blocks, and then either forcibly
reboot or power cycle the box, or yank the USB key out while the
storage device is still being written (before e2fsck exits).

So rearrange the exit path of e2fsck so that we flush out the dirty
superblock/bg descriptors/bitmaps before we print the final message.
Also clean up this code so that the flow of control is easier to
understand, and add error checking to catch any errors (normally
caused by I/O errors writing to the disk) for these final writebacks.

Addresses-Debian-Bugs: #757543, #757544
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Dan Jacobson <jidanni@jidanni.org>
2014-08-10 18:12:02 -04:00
Theodore Ts'o 84d6dd7858 tests: add the r_meta_bg_shrink test
This test checks to make sure resize2fs can properly handle a file
system which started life as a normal ext4 file system and then was
grown to a size where meta_bg was enabled, and then shrunk back below
the point where the meta_bg format is still needed.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-10 18:11:54 -04:00
Theodore Ts'o 755e077181 tests: add f_first_meta_bg_too_big test
The test verifies that e2fsck can properly fix a file system where the
value of s_first_meta_bg in the superblock is larger than the number
of block group descriptors in the file system.  E2fsck will fix this
by clearing the meta_bg feature.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-10 16:21:31 -04:00
Theodore Ts'o 9974f8c2be tests: make sure MKE2FS_FIRST_META_BG is unset while running tests
If the developer has set the MKE2FS_FIRST_META_BG environment
variable, this can cause test failures.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-10 16:21:31 -04:00
Theodore Ts'o c82815e509 resize2fs: disable the meta_bg feature if necessary
When shrinking a file system, if the number block groups drops below
the point where we started using the meta_bg layout, disable the
meta_bg feature and set s_first_meta_bg to zero.  This is necessary to
avoid creating an invalid/corrupted file system after the shrink.

Addresses-Debian-Bug: #756922

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reported-by: Marcin Wolcendorf <antymat+debian@chelmska.waw.pl>
Tested-by: Marcin Wolcendorf <antymat+debian@chelmska.waw.pl>
2014-08-10 16:21:08 -04:00
Theodore Ts'o 7a4352dccd e2fsck: fix file systems with an overly large s_first_meta_bg
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-10 16:21:08 -04:00
Theodore Ts'o f66e6ce444 libext2fs: avoid buffer overflow if s_first_meta_bg is too big
If s_first_meta_bg is greater than the of number block group
descriptor blocks, then reading or writing the block group descriptors
will end up overruning the memory buffer allocated for the
descriptors.  Fix this by limiting first_meta_bg to no more than
fs->desc_blocks.  This doesn't correct the bad s_first_meta_bg value,
but it avoids causing the e2fsprogs userspace programs from
potentially crashing.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-10 16:20:59 -04:00