Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
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>
|
|
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>
|
|
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
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>
|
|
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>
|
|
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>
|
|
The f_illitable_flexbg test was failing on ppc, because
e2fsck_move_ext3_journal is doing a direct memcmp of i_block with
s_jnl_blocks, and failing.
This is because we don't swap extent data on read from disk; rather
we do it when we access the extents. However, ext2fs_swap_super
was swapping s_jnl_blocks unconditionally, so these didn't match.
Looks like we need to treat s_jnl_blocks the same as i_block, and
swap it on access, not on read. Except for the last i_size bit...
Reviewed-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
Resizing a filesystem with an external journal fails when it tries
to read inode 0:
# touch testfs
# truncate testfs 1342177280
# touch testjournal
# truncate testjournal 134217728
# mke2fs -O journal_dev testjournal
# losetup /dev/loop0 testjournal
# mkfs.ext4 -J device=/dev/loop0 testfs 127680
# resize2fs testfs
resize2fs 1.41.9 (22-Aug-2009)
Resizing the filesystem on testfs to 327680 (4k) blocks.
resize2fs: Illegal inode number while trying to resize testfs
Please run 'e2fsck -fy testfs' to fix the filesystem
after the aborted resize operation.
I think the right, simple thing to do is just bail out early
for an external journal here, as there are no backup blocks
to update.
Reported-by: mjevans1983@gmail.com
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
Clear the function pointer for readline_shutdown() so that if libss is
linking against a readline library which doesn't supply a
readline_shutdown() function, ss_delete_invocation() won't seg fault.
Thanks to Solar Designer <solar@openwall.com> for reporting this
problem to me.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
Commit 06807d9 had a typo; we need util-linux-ng >= 2.15~rc1-1, not
<< 2.15~rc1-1!
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
Addresses-Debian-Bug: #551795
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
Signed-off-by: Michael Roth <mroth@nessie.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
Addresses-Launchpad-Bug: #448099
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
I think vim <esc>wq turned into <esc>2wq or something; in any case
blkid_probe_get_topology2 is not the right thing to search for.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
|
|
If the RO compat HUGE_FILE feature flag is set, but the inode's
HUGE_FILE_FL flag is not set, we should still pay attention to the
high 32 bits of the i_blocks filed.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
Unfortunately, due to Windows' unfortunate design decision to
configure the hardware clock to tick localtime, instead of the more
proper and less error-prone UTC time, many users end up in the
situation where the system clock is incorrectly set at the time when
e2fsck is run.
Historically this was usually due to some distributions having buggy
init scripts and/or installers that didn't correctly detect this case
and take appropriate countermeasures. However, it's still possible,
despite the best efforts of init script and installer authors to not
be able to detect this misconfiguration, usually due to a buggy or
misconfigured virtualization manager or the installer not having
access to a network time server during the installation process. So
by default, we allow the superblock times to be fudged by up to 24
hours. This can be disabled by setting options.accept_time_fudge to
the boolean value of false in e2fsck.conf. The old
options.buggy_init_scripts is left for backwards compatibility.
Since we are now accepting the 24 hour time fudge by default, there is
no longer a need to install an Ubuntu-specific e2fsck.conf file, so we
can remove it.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
E2fsck was not properly printing the i_blocks field in filesystem
corruption messages, and it was not properly checking i_blocks_hi and
i_blocks_lo, either. This commit fixes this.
Thanks to Felipe Conteras for pointing this out.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
Non-expert users get confused when they see messages like this:
Illegal block #-1 (2291965952) in inode 176. CLEARED.
So change it to be something a little bit more understandable:
Illegal indirect block (2291965952) in inode 176. CLEARED.
Addresses-SourceForge-Bug: #2871782
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
Commit 1d9b818: dumpe2fs: Print more information about the inline journal
caused dumpe2fs to use ext2fs_file_open2(). Previously the file_io
functions were only used by debugfs, so if debugfs was disabled,
file_io was not built. Now that dumpe2fs is also using file_io, we
need to build it unconditionally.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
The previous commit adds a new line printed by mke2fs with the
filesystem/device topology information. Update the regression test's
expected output to account for this.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
Handle automatic selection of stride/stripe:
mke2fs 1.41.9 (22-Aug-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=16 blocks, Stripe width=32 blocks
...
And warn on block device misalignment:
mke2fs 1.41.9 (22-Aug-2009)
/dev/sdc1 alignment is offset by 32256 bytes.
This may result in very poor performance, (re)-partitioning suggested.
Proceed anyway? (y,n)
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
This commit forces the use of the system-provided blkid or uuid header
files if we are using the system-provided blkid or uuid libraries.
This avoids using the in-tree header files with the system libraries.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
This error isn't terribly important, but apparently it causes some
users/developers distress.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
If the cmd_file is not stdin, we should close the file handle via fclose().
Thanks David Binderman to point this out.
Addresses-Novell-Bugzilla: #524526
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
fsck leaks fds when invoked with -R -A -M -a -t noopts=nofail
Signed-off-by: Cristian RodrÃguez <crrodriguez@opensuse.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
The x86 BT assembly instructure can overshoot the end of a bit array
when testing a bit at the end of the bit array, even if it never needs
to look at those memory locations. This can cause a spurious
segmentation fault. If we allocate a little extra memory, it avoids
this problem. See:
http://faydoc.tripod.com/cpu/bt.htm
This doesn't happen on Linux, probably because of the glibc's malloc()
function works, but apparently it's a major problem on the *BSD
operating systems.
Addresses-Sourceforge-Bug: #2328708
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
Add a more explicit description of how specifying the flex_bg file
system feature changes the layout of the per-block group metadata.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
Addresses-Sourceforge-Bug: #2822186
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
|
When flex_bg is on, calculate_minimum_resize_size() should add more meta
blocks for newly added flex_bg.
Addresses-RedHat-Bugzilla: #519131
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
|
When running resize2fs -M, no need to recalculate the minimal fs size.
Signed-off-by: "Peng Tao" <bergwolf@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|