Commit Graph

4979 Commits (7a8f49735679c86d34e0840dcfde1340da6de90a)

Author SHA1 Message Date
Darrick J. Wong 7a8f497356 mke2fs: allow creation of journal device with superblock checksum
Enable mke2fs to create an external journal device with a superblock
checksum.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Cc: TR Reardon <thomas_reardon@hotmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-11 12:40:55 -04:00
Darrick J. Wong fc06f25a10 libext2fs: write_journal_inode should check iterate return value
When creating a journal inode, check the return value from
block_iterate3() because otherwise we fail to capture errors such as
being unable to allocate an extent tree block, which leads to e2fsck
creating broken journals.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-11 12:40:54 -04:00
Darrick J. Wong 4f769f4c03 misc: don't return ENOMEM if we run out of disk space
If there aren't enough blocks in the FS to allocate all of the
hugefiles, return ENOSPC, not ENOMEM.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-11 12:40:54 -04:00
Darrick J. Wong f92c600c09 libext2fs: report bad magic over bad sb checksum
We don't want ext2fs_open2() to report bad sb checksum on something
that's not even an ext* superblock.  This apparently happens pretty
easily if we try to open an XFS filesystem.  Thus, make it so that a
bad magic number code always trumps the sb checksum error code.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-11 12:40:54 -04:00
Darrick J. Wong 38d5adf339 e2fsck/debugfs: fix descriptor block size handling errors with journal_csum
It turns out that there are some serious problems with the on-disk
format of journal checksum v2.  The foremost is that the function to
calculate descriptor tag size returns sizes that are too big.  This
causes alignment issues on some architectures and is compounded by the
fact that some parts of jbd2 use the structure size (incorrectly) to
determine the presence of a 64bit journal instead of checking the
feature flags.  These errors regrettably lead to the journal
corruption reported by Mr. Reardon.

Therefore, introduce journal checksum v3, which enlarges the
descriptor block tag format to allow for full 32-bit checksums of
journal blocks, fix the journal tag function to return the correct
sizes, and fix the jbd2 recovery code to use feature flags to
determine 64bitness.

Add a few function helpers so we don't have to open-code quite so
many pieces.

Switching to a 16-byte block size was found to increase journal size
overhead by a maximum of 0.1%, to convert a 32-bit journal with no
checksumming to a 32-bit journal with checksum v3 enabled.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reported-by: TR Reardon <thomas_reardon@hotmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-11 12:40:54 -04:00
Theodore Ts'o 330cebc0e9 Merge branch 'maint' into next
Conflicts:
	debugfs/debugfs.c
	e2fsck/Makefile.in
	lib/ext2fs/Makefile.in
	tests/test_config
2014-09-11 12:40:43 -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 b874d24629 v1.42.12
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJUAIPFAAoJENNvdpvBGATwoZ8P/AxCEVC90Cj+lz8ayEJ/v0RB
 Q61qScNMuzgzPLA6xfFUQqnnAzLFIvhlLazGbOJFDDrIc9Ek4HZZqTldsJTK+B3l
 V5X+o66E1U9+gL64qBKuJz+anS09jGLLrKvH1Ok+vMtD35xPxkrPa0Egrw5/q2gD
 3YXxvQHSuTGx3qHwTJ6MNpBM2O7DSNRV3lARLRY3rkIkRUPPBLPiqYaL2tTE7Er1
 9I5ENKURrHu4uZ3b0OLD3SGhdesLWsguzMzrep0vOZ7PSfmLSZiiURA3puyHj2hl
 Ixxk+qFqv9mUq86rUo+we9N0qU4dKbfdOxMCbY7DyGJdoDzDQany3zw5EG/XO+Ws
 MKJ1qUm30l32FrqkFkFwL0PWzCssV86lfwsIt4f3My3v61C91B9YbxMR2magzmB5
 B1yTCyEWu4hgPld98fgq1cVVpeWtxCejG7llg4gsDbRwJYlv+hSVVBBPmEofr4F7
 j2GdRm5KXKIBETx1WWqLeTHhDrD68rpU8RISrCPOYUBmFdyNA3H38ret23GvF6BT
 Im/xlxhAWL/EzBEYA6OyvckWA2VUvYH3jEoSZwtgpxeSIFP0ABInPrmsTLHY2kdI
 cx9VWV9+0GdVUc/ObSud4FHYcdc7IyGaKZp0M2YlYTQTqDIBZDiy1liyHYQ4/rvb
 20I2th2DbtdTpMiPlHgJ
 =igQE
 -----END PGP SIGNATURE-----

Merge tag 'v1.42.12' into next

v1.42.12

Conflicts:
	version.h
2014-08-29 11:38:33 -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
Darrick J. Wong bf93a9685e e2fsck: fix infinite loop when recovering corrupt journal blocks
When recovering the journal, don't fall into an infinite loop if we
encounter a corrupt journal block.  Instead, just skip the block and
proceed with the full filesystem fsck.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-26 23:45:11 -04:00
Darrick J. Wong 97f168b67e e2fsck: resync jbd2 revoke code from Linux 3.16
Synchronize e2fsck's copy of revoke.c with the kernel's copy in
fs/jbd2.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-26 23:43:20 -04:00
Darrick J. Wong 13af4b93fb e2fsck: resync jbd2 recovery code from Linux 3.16
Synchronize e2fsck's copy of recovery.c with the kernel's copy in
fs/jbd2.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-26 23:32:14 -04:00
Darrick J. Wong 389931ca1f contrib: add script to help resync journal code with kernel
Add a script that handles (most) of the code massaging necessary to resync
{recovery,revoke}.c from the Linux kernel into e2fsprogs.

Usage: jbd2-resync.sh linux/fs/jbd2/revoke.c e2fsprogs/e2fsck/revoke.c

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-26 23:32:05 -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 c1c8800b71 Merge branch 'maint' into next
Conflicts:
	RELEASE-NOTES
	debian/changelog
	version.h
2014-08-25 18:37:37 -04:00
Theodore Ts'o d9eab8e2f0 tests/d_inline_dump: remove version dependency in the expected output
Also add the convenience macro $CLEAN_OUTPUT in test_config which can
be used to run the "sed -e $cmd_dir/filter.sed" command to clean up
e2fsprogs command output before comparing with the expected golden
output.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-25 18:04:42 -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
Darrick J. Wong 4348709c5c e2fsck: on BE, re-swap everything after a damaged dirent so salvage works correctly
On big-endian systems, if the dirent swap routine finds a rec_len that
it doesn't like, it continues processing the block as if rec_len == 8.
This means that the name field gets byte swapped, which means that
salvage will not detect the correct name length (unless the name has a
length that's an exact multiple of four bytes), and it'll discard the
entry (unnecessarily) and the rest of the dirent block.  Therefore,
swap the rest of the block back to disk order, run salvage, and
re-swap anything after the salvaged dirent.

The test case for this is f_inlinedata_repair if you run it on a BE
system.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-24 22:02:49 -04:00
Darrick J. Wong 2432a41a58 libext2fs: fix problems with LE<->BE conversions on BE platforms
Fix more problems that I found when testing on ppc64:

- Inode swap cut and paste error leads to immutable inodes being
  detected as inlinedata inodes, leading to e2fsck incorrectly barfing
  on i_block[] contents.

- Superblock csum/verify must be aware of the fs->super byte order
  when checking for metadata_csum feature flag.  (Hint: in _openfs(),
  fs->super is in LE order for the first csum verification)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-24 22:01:36 -04:00
Darrick J. Wong 18b234b121 libext2fs: byteswap inode when performing the sanity scan
On BE platforms, we need to swap the inode bytes after doing the
checksum verification but before looking at i_blocks.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-24 22:00:56 -04:00
Darrick J. Wong 7248e265c7 e2fuzz: fix pwrite64/pwrite usage
Select pwrite64 or pwrite depending on what autoconf finds.  This
makes e2fuzz find a suitable pwrite variant regardless of platform.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-24 19:55:42 -04:00
Darrick J. Wong c4c9bc590c misc: fix gcc warnings
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-24 12:22:11 -04:00
Darrick J. Wong 8a17df7195 libext2fs: create inlinedata symlinks
Add to ext2fs_symlink the ability to create inline data symlinks.

[ Modified by tytso to add more logging to the test script ]

Suggested-by: Pu Hou <houpu.hp@alibaba-inc.com>
Cc: Pu Hou <houpu.hp@alibaba-inc.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-24 12:21:16 -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 aef977196a Merge branch 'maint' into next 2014-08-15 19:01:24 -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