Commit Graph

3253 Commits (2291fbb0358be8251df0d611913f49fbb9beb740)

Author SHA1 Message Date
Theodore Ts'o 2291fbb035 e2fsck: Check for cases where EOFBLOCKS_FL is unnecessarily set
Some kernels will crash if EOFBLOCKS_FL is set when it is it not
needed, and this if it is left set when it isn't needed, it is a sign
of a kernel bug.

Addresses-Google-Bug: #2604224

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-10 10:29:14 -04:00
Petr Pisar bc11f0dacc po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-05-06 14:49:49 -04:00
Dark Raven 3be22a8197 po: update zh_CN.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-04-19 16:59:03 -04:00
Clytie Siddall f8e76c854b po: update vi.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-04-19 16:59:03 -04:00
Jakub Bogusz 92ec60104c po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-04-19 16:59:03 -04:00
Benno Schulenberg 4544b08a8d po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-04-19 16:59:03 -04:00
Arif E. Nugroho af8d541c58 po: update id.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-04-19 16:59:03 -04:00
Samuel Thibault 2fad98f6fa po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-04-19 16:59:03 -04:00
Philipp Thomas 77c871adf7 po: update de.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2010-04-19 16:59:02 -04:00
Theodore Ts'o d9af85b50b Revert "e2fsck: fix spurious complaints about i_size caused by preallocated blocks"
This reverts commit 0ea910997b.

Since the Linux kernel now has support for the EXT4_EOFBLOCKS_FL flag
starting in 2.6.34, we don't need this workaround any more.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-04-08 15:51:10 -04:00
Theodore Ts'o 7b6f59204e Update release notes, version string, etc. for e2fsprogs 1.41.11 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:57:42 -04:00
Theodore Ts'o 29516bbdd2 debian: Update compliance to debian policy to 3.8.4
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:56:58 -04:00
Theodore Ts'o 025d1e77c8 debian: static build no longer needs -fno-stack-protector
From: Kees Cook <kees@debian.org>

I noticed that the debian/rules contains "-fno-stack-protector".  While
this used to be needed a while back, this is no longer required, as the
stack protection code will be statically compiled into the static e2fsprogs
correctly now.

Addresses-Debian-Bug: #573923

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:15:59 -04:00
Theodore Ts'o ec65fa57a6 tests: Add new test f_rehash_dir
Add a new test which tests to make sure e2fsck -D works correctly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:14:12 -04:00
Theodore Ts'o 1601b10e65 libcom_err: Add support for Heimdal com_right_r function()
Addresses-Sourceforge-Bug: #2963865
Addresses-Debian-Bug: #558910

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:14:12 -04:00
Theodore Ts'o 59119646bd e2fsck: Don't blow up if the physical device is too big
If the user grows a partition bigger than 2**32 blocks, e2fsprogs
1.41.x is not going to be able to support resizing the filesystem,
since it doesn't have > 2**32 block support.  However, e2fsck should
still work, so the system administrator doesn't get stuck.

Addresses-Launchpad-Bug: #521648

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:14:12 -04:00
Theodore Ts'o de2c477815 debugfs: Correctly show the allocation status of a block using logdump
The offset in the bitmap was not getting correctly calculated when the
user specifics a block to track using "logdump -b <block-num>"

Addresses-Debian-Bug: #564084

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:14:12 -04:00
Theodore Ts'o 751265b0b4 e2fsck: Make the "filesystem is mounted" message more scary
I guess the message wasn't scary enough for users who are just smart
enough to really get themselves in deep doo-doo.  Let's make it even
scarier.

Addresses-Launchpad-Bug: #537483

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:14:12 -04:00
Theodore Ts'o 298c9c2f2e e2fsck: Make the -n always open the file system read-only
A user was surprised when -n -D caused the file system to be opened
read/write, and then outsmarted himself when e2fsck asked the question:

   WARNING!!!  Running e2fsck on a mounted filesystem may cause
   SEVERE filesystem damage.

   Do you really want to continue (y/n)?

This is partially our fault for not documenting the fact that -D
overrode opening the filesystem read-write.  But the bottom line is it
much safer if -n *always* opens the file system read-only, so there
can be no confusion.  This means that we have to disable certain
combination of options, such as "-n -c", "-n -l", and "-n -L", and
"-n -D", but the utility of these combinations is pretty low, and
is more than offset by making e2fsck idiot-proof.

Addresses-Launchpad-Bug: #537483

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:14:12 -04:00
Eric Sandeen ecced2c358 mke2fs: Don't ask to proceed in case of a badly aligned partition
Just print the warning message in this case.

Addresses-Red-Hat-Bug: #569021
Addresses-Launchpad-Bug: #530071

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-15 00:14:00 -04:00
Theodore Ts'o 8e2399d57a ext2fs: Optimize extending an extent-mapped file using ext2fs_block_iterate2()
When ext2fs_block_iterate2() is called on an extent-mapped file with a
depth > 1, it will erroneously calling the callback function starting
all over again with an offset of logical block 0.  It shouldn't do
this, and it cases mke2fs to become very slow when creating files with
very large journals.

Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-03-11 15:58:54 -05:00
Eric Sandeen 4ffafee26c e2fsck: don't complain about i_size for known blocks past EOF
This is the userspace side of Jiaying's EOFBLOCKS patch.  With
Aneesh's patches for .33, Jiaying's patch, and this one, xfstests
013/fsstress (even with direct IO enabled) has held up through many
runs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-02-24 11:24:37 -05:00
Theodore Ts'o 53fbfb2bc3 e2fsck: Fix bug which can cause e2fsck -fD to corrupt non-indexed directories
E2fsprogs 1.41.10 introduced a regression (in commit b71e018) where
e2fsck -fD can corrupt non-indexed directories when are exists one or
more file names which alphabetically sort before ".".  This can happen
with ext2 filesystems or for small directories (take less than a
block) which contain filenames that begin with a space or some other
punctuation mark.

Fix this by making sure we never reorder the '.' or '..' entry in the
directory, since they must be first.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-02-22 23:51:26 -05:00
Theodore Ts'o 9080695a4e Update release notes, version string, etc. for e2fsprogs 1.41.10 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-02-10 15:49:32 -05:00
Eric Sandeen 13b0b1231e mke2fs: fix up topo complaints on regular files
mkfsing a plain file would lead to a warning about being unable
to determine geometry; we should just skip the topology-getting
if we see that we have a regular file.

This was breaking "make check" but I had missed it since I
inadvertently stopped running the checks during the Fedora
RPM build.

Also, add a newline to the warning.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-02-05 22:50:21 -05:00
Theodore Ts'o 4828bbe9e7 resize2fs: Fix fix uninit group test accessing invalid memory
Commit 74128f8 added tests for uninit groups, but it could access past
the end of the group_desc[] array after processing the last group:

==19668== Invalid read of size 2
==19668==    at 0x40518C: resize_fs (resize2fs.c:1824)
==19668==    by 0x405A46: main (main.c:451)
==19668==  Address 0x5a0d002 is not stack'd, malloc'd or (recently) free'd
==19668==
==19668== Invalid read of size 2
==19668==    at 0x405391: resize_fs (resize2fs.c:1864)
==19668==    by 0x405A46: main (main.c:451)
==19668==  Address 0x5a0d002 is not stack'd, malloc'd or (recently) free'd
==19668==

It was found by Eric Sandeen running the regression suite through
valgrind.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-02-05 22:50:19 -05:00
Eric Sandeen 4e79a19fe0 libss: add newer libreadline to dlopen path
Rawhide now has libreadline.so.6 ... add it to the ever-expanding
list of libs to look for.

Unfortunately without commit 06ef971be5
this fails in a rather cryptic way.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-02-05 22:50:10 -05:00
Nick Dokos 1ec42a00a5 e2fsck: Fix the check if a file is really a directory to understand extents
Pass 1 has a test to see if a special file is really a directory.

Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-02-05 10:41:42 -05:00
Theodore Ts'o c70674387e e2fsck: Add new e2fsck.conf option: broken_system_clock
The broken_system_clock allows the time to be in the future when in
preen mode.  It's useful for people who have, as the name implies,
broken system clocks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-01-04 13:59:04 -05:00
Theodore Ts'o bbb60e4fef libext2fs: Improve flex_bg inode table placement algorithm
When trying to find the best place for the inode table in the last
flex block group, use the true size for the flex_bg's portion of the
inode table instead of the worst case required size of the inode table
fragment if the file system is resized.  This fixes a corner case
where if the size of the filesystem is just big enough that there is
only room for a single block group in the last flex_bg, and that
partial block group is too small for the full portion of the inode
table, the inode table is placed in the very first block group:

Group 64: (Blocks 2097152-2099199) [INODE_UNINIT, ITABLE_ZEROED]
  Checksum 0xd305, unused inodes 8080
  Block bitmap at 2097152 (+0), Inode bitmap at 2097168 (+16)
  Inode table at 8626-9130 (+4292878770)
                 ^^^^^^^^^

Thanks to Vyacheslav Dubeyko for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-30 12:24:59 -05:00
Theodore Ts'o 7bb82079a5 debian: Add source lintian overrides
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 23:33:26 -05:00
Theodore Ts'o 4534f8bc3f debian: Fix FTBFS problem caused by texi2html changing its output location
Unfortunately, texi2html gratuitously changed its behavior of where
its output html files are placed when the -split_chapter is in effect.
(First it was in a subdirectory; then it was in the current directory;
now it's back to putting the output html files in a subdirectory
again.)

Support either way of doing things since the texi2html team seems to
be indecisive...

Addresses-Debian-Bug: #552934

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 20:19:10 -05:00
Theodore Ts'o 785f939046 tests: Add new test f_holedir2
This tests e2fsck's handling of both direct and extent-mapped
directoris containing holes when the i_size is 0.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 01:28:14 -05:00
Theodore Ts'o 8a2cbe2c6d e2fsck: Try to update on-disk bitmap in e2fsck_get_alloc_block() callback
The e2fsck_get_alloc_block() callback is used so that if the ext2fs
library needs to allocate blocks internally (most notably by the
extents functions), e2fsck's internal block usage map is consulted
since it is the only thing that can be trusted during a large part of
e2fsck's operation.

Change it to update the on-disk bitmap if it is loaded.  This reduces
the number of spurious differences found in pass #5.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 01:24:06 -05:00
Theodore Ts'o f4e14505ed e2fsck: Don't rehash directories which can fit in a single directory block
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 01:22:44 -05:00
Theodore Ts'o 3a6be7bc18 e2fsck: Fix block allocation for holes in extent-mapped directories
In pass 2, when allocating new blocks for holes in directories, use
ext2fs_set_bmap() instead of ext2fs_block_iterate2() with a helper
function so that the newly allocated directory blocks are correctly
assigned in extent-mapped directories.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 01:12:12 -05:00
Theodore Ts'o 9c9e1d5fe5 libext2fs: Fix SET_BMAP bugs in ext2fs_bmap() and ext2fs_bmap2()
Don't byte-swap the block number when setting i_block[x], since the
write_inode function will take of byte swapping the inode.

The phys_blk parameter contains an input parameter in the SET_BMAP
case, so it must be passed to ext2fs_bmap2() from the legacy function
ext2fs_bmap().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 01:03:04 -05:00
Theodore Ts'o 4607ef7d53 e2fsck: detect holes in extent-mapped directories
Directories are not allowed to be sparse; the code for scanning
extent-mapped directories was not calling ext2fs_add_dir_block() for
missing directory blocks, so we weren't catching this form of file
system corruption.  Fix this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 01:03:04 -05:00
Theodore Ts'o ca92d98f0a filefrag: Fix a core dump on sparc32 platforms with 8k file systems
On 32-bit platforms where the file system block size is 8k or greater,
the calculation bpib*bpib*bpib* will overflow a 32-bit calculation,
leading to a divide by zero error.  Fix this.

Thanks to Mikulas Patocka for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 01:03:04 -05:00
Theodore Ts'o a49249d2e3 e2fsck: Move check to add an index to a directory after fixing i_size
The check that determines whether an directory needs to be have an
index added to it depends on i_size.  So move it after we have fixed
up i_size so that we reliable will rehash a directory that needs it,
even if its i_size field was originally incorrect.  Otherwise, a
second run of e2fsck would be needed before the directory gets an
index added.

Thanks to Mikulas Patocka for providing a sample file system which
demonstrated this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 01:03:04 -05:00
Theodore Ts'o 4dbe79bcf3 e2fsck: Fix directory with holes even when i_size is wrong
The old method for detecting directories with holes depended on i_size
being correct, even though the correct value of i_size hadn't been
calculated yet.  Hence, a directory inode with holes and an i_size of
0 would require two e2fsck passes to fix completely.

The replacement method for determining whether or not
ext2fs_add_dir_block() should be called is more reliable, and reduces
the size of e2fsck and makes the code more readable as a bonus.

Thanks to Mikulas Patocka for providing a sample file system which
demonstrated this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29 01:02:46 -05:00
Jakub Bogusz bd6793fe8d po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-27 15:23:14 -05:00
Theodore Ts'o 57aa50d4a1 configure: Work around bug in autoconf 2.64
In autoconf 2.64, if AC_CHECK_LIB is first used in a conditional that
evaluates to false, the helper function ac_fn_c_try_link gets defined
inside that conditional, and then subsequent attempts to use
ac_fn_c_try_link() will blow up.  Work around this by moving an
unconditional use of AC_CHECK_LIB to the beginning of configure.in.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-26 10:38:04 -05:00
Eric Sandeen f3befe3e6b mke2fs: open device writable for trim/discard
Sorry about that, the discard ioctl doesn't actually work
unless you open the file with write capabilities...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-25 07:05:37 -05:00
Clytie Siddall 2ce7387cc6 po: update vi.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-25 07:00:40 -05:00
Arif E. Nugroho f34add40ca po: update id.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-25 07:00:39 -05:00
Petr Pisar f5074193a1 po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-25 07:00:39 -05:00
Theodore Ts'o b71e01835f e2fsck: Fix duplicate directory entries for non-indexed directories
Duplicate directory entries were not necessarily getting found and
fixed for non-indexed directories, since we were sorting these
directories by inode number, and the duplicate entry code assumed the
entries were getting sorted by name or directory name hash.

Addresses-Sourceforge-Bug: #2862551

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-16 21:56:24 -05:00
Eric Sandeen c7cd908be5 mke2fs support for BLKDISCARD
Try calling the BLKDISCARD ioctl at mkfs time to pre-discard all blocks
on an ssd, or a thinly-provisioned storage device.

No real error checking; if it fails, it fails, and that's ok - it's
just an optimization.  Also, it cannot work in conjunction with
the undo io manager, for obvious reasons.

Optionally disabled with a "-K" (mnemonic: Keep) option.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-16 21:53:39 -05:00
Karel Zak 5f91561ae7 libext2fs: handle <=linux-2.6.19 bug in /proc/swaps
Linux <= 2.6.19 contained a bug in the /proc/swaps code where the
header would not be displayed (the first line).

This issue has been reported by Mike Frysinger for swapon(8).

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-13 08:48:29 -05:00