summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-01-04e2fsck: Add new e2fsck.conf option: broken_system_clockTheodore Ts'o2-1/+23
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>
2009-11-30libext2fs: Improve flex_bg inode table placement algorithmTheodore Ts'o1-0/+2
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-29debian: Add source lintian overridesTheodore Ts'o1-0/+3
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29debian: Fix FTBFS problem caused by texi2html changing its output locationTheodore Ts'o5-11/+28
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-29tests: Add new test f_holedir2Theodore Ts'o4-0/+33
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-29e2fsck: Try to update on-disk bitmap in e2fsck_get_alloc_block() callbackTheodore Ts'o1-0/+4
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-29e2fsck: Don't rehash directories which can fit in a single directory blockTheodore Ts'o3-7/+19
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-11-29e2fsck: Fix block allocation for holes in extent-mapped directoriesTheodore Ts'o1-28/+2
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-29libext2fs: Fix SET_BMAP bugs in ext2fs_bmap() and ext2fs_bmap2()Theodore Ts'o1-4/+1
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-29e2fsck: detect holes in extent-mapped directoriesTheodore Ts'o1-0/+13
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-29filefrag: Fix a core dump on sparc32 platforms with 8k file systemsTheodore Ts'o1-1/+1
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-29e2fsck: Move check to add an index to a directory after fixing i_sizeTheodore Ts'o1-4/+6
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-29e2fsck: Fix directory with holes even when i_size is wrongTheodore Ts'o1-44/+15
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-27po: update pl.po (from translationproject.org)Jakub Bogusz2-2/+2
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-26configure: Work around bug in autoconf 2.64Theodore Ts'o2-8685/+3038
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-25mke2fs: open device writable for trim/discardEric Sandeen1-1/+1
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-25po: update vi.po (from translationproject.org)Clytie Siddall2-521/+504
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-25po: update id.po (from translationproject.org)Arif E. Nugroho2-27/+41
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-25po: update cs.po (from translationproject.org)Petr Pisar2-3/+3
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-11-16e2fsck: Fix duplicate directory entries for non-indexed directoriesTheodore Ts'o5-6/+30
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-16mke2fs support for BLKDISCARDEric Sandeen2-2/+60
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-13libext2fs: handle <=linux-2.6.19 bug in /proc/swapsKarel Zak1-1/+11
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-12libext2fs: don't swap extent-based journal backupEric Sandeen1-1/+11
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>
2009-11-12resize2fs: exit fix_sb_journal_backup early for external journalEric Sandeen1-0/+4
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>
2009-11-12libss: initialize function pointer for readline_shutdown()Theodore Ts'o1-0/+1
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>
2009-10-28debian: Fix pre-depends relation for util-linux-ngTheodore Ts'o1-1/+1
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>
2009-10-24debian: Add pre-depends for util-linux for util-linux-ng buildsTheodore Ts'o1-1/+5
Addresses-Debian-Bug: #551795 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-24Update .gitignoreMichael Roth1-0/+23
Signed-off-by: Michael Roth <mroth@nessie.de> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-10-24tune2fs.8: Clarify tune2fs's -i optionTheodore Ts'o1-4/+6
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-24dumpe2fs: Fix usage message for -o superblock=<num> and -o blocksize=<num>Theodore Ts'o1-2/+2
Addresses-Launchpad-Bug: #448099 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-21configure.in: Fix typo: remove '2' from blkid_probe_get_topology2Eric Sandeen2-2/+2
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>
2009-10-21libext2fs: Fix FEATURE_RO_COMPAT_HUGE_FILE && !HUGE_FILE_FLTheodore Ts'o1-27/+40
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>
2009-10-16e2fsck: Accept superblock times to be fudged by up to 24 hours by defaultTheodore Ts'o5-42/+48
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>
2009-10-12e2fsck: Fix handling of non-zero i_blocks_high fieldTheodore Ts'o2-4/+14
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>
2009-10-04e2fsck: Interpret negative blkcount in file system problem reportsTheodore Ts'o10-985/+1010
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>
2009-10-04libext2fs: Always build file_io.cTheodore Ts'o1-2/+2
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>
2009-10-04tests: Account for new mke2fs topology informationTheodore Ts'o8-0/+8
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>
2009-10-04mke2fs: get device topology values from blkidEric Sandeen3-2/+154
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>
2009-10-04Don't use in-tree header files if using system uuid or blkid librariesTheodore Ts'o12-232/+221
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>
2009-10-03e2fsck: Use the correct problem code in the case of LAST_WRITE_FUDGEDTheodore Ts'o1-1/+1
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-03blkid: Avoid a potentially error message when running "make clean"Theodore Ts'o1-1/+2
This error isn't terribly important, but apparently it causes some users/developers distress. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-03debugfs: add matching fclosePeng Tao1-0/+2
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>
2009-10-03fix fd leak that causes fsck to fail with "too many open files"Cristian Rodríguez1-3/+0
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>
2009-09-08libext2fs: Add error table initialization to test programsTheodore Ts'o4-1/+6
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-08e2undo: Initialize com_err error tables for the ext2fs libraryTheodore Ts'o1-0/+1
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07libext2fs: Round up the bitmap size when allocating a new bitmapTheodore Ts'o1-0/+2
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>
2009-09-07mke2fs.8.in: Clarify flex_bg feature descriptionTheodore Ts'o2-27/+39
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>
2009-09-07tune2fs.8: Document the flex_bg file system option in the man pageTheodore Ts'o1-7/+11
Addresses-Sourceforge-Bug: #2822186 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-09-07resize2fs: fix minimum resize size calculation with flex_bgPeng Tao1-3/+17
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>
2009-09-07resize2fs: calculate minimal fs size only oncePeng Tao1-1/+1
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>