summaryrefslogtreecommitdiff
path: root/e2fsck/pass1.c
AgeCommit message (Collapse)AuthorFilesLines
2006-11-14Fix misc. gcc -Wall complaints in the misc and e2fsck directoriesTheodore Ts'o1-4/+3
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-11-11On-disk format definition for huge filesTheodore Ts'o1-4/+5
- EXT4_FEATURE_RO_COMPAT_HUGE_FILE (0x0008) - change i_blocks to be in units of s_blocksize units instead of 512-byte sectors, use l_i_frag and l_i_fsize as i_blocks_hi (could also be part of 64BIT). E2fsck and debugfs changed to support i_blocks_hi instead of l_i_frag and l_i_fsize. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-09-12Fix more rounding overflows for filesystems that have 2**32-1 blocksEric Sandeen1-1/+1
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-09-12Create new ext2fs library inlines: ext2fs_group_{first,last}_block()Eric Sandeen1-4/+6
Create new ext2fs library inline functions in order to calculate the starting and ending blocks in a block group. Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-09-12Remove unused variablesEric Sandeen1-3/+1
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2005-07-25Fix false positives from valgrind: memcpy via no-op structure copyTheodore Ts'o1-1/+2
Don't do a structure copy via an assignment in e2fsck's pass #1 when it is a no-op in order to avoid false positives from valgrind. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-04-14Use a centrally stored current time for "now" which Theodore Ts'o1-5/+10
can be overridden using the E2FSCK_TIME environment variable, for better reproducibility for regression tests.
2005-04-06pass1.c (e2fsck_pass1): If the superblock last mount time (notTheodore Ts'o1-1/+2
just the last write time) looks insane, then assume that we can't do the LOW_DTIME checks.
2005-03-21Integrate code from Alex Thomas at Clusterfs to check extended attributesTheodore Ts'o1-72/+213
stored in inodes into e2fsck. There are a number of bug fixes and enhancements over the original lustre fsck BK repository. The biggest one is that this extended attribute values must be aligned on 4-byte boundaries.
2005-03-20Fix bug in e2fsck where we don't notice if a file with an extendedTheodore Ts'o1-3/+3
attribute block is so big that i_blocks wraps to zero.
2004-12-24Add support to detect corrupted resize_inode's to e2fsck.Theodore Ts'o1-8/+26
2004-12-15Add support for on-line resizing ala the resize inode. This patchTheodore Ts'o1-1/+12
is taken from Fedora Core 3's e2fsprogs 1.35-11.2.src.rpm's e2fsprogs-resize.patch.
2004-07-26pass1.c (process_block): Change the limit of directory size fromTheodore Ts'o1-1/+1
32 MB to 2GB.
2004-03-30unix_io.c, pass1.c:Matthias Andree1-1/+1
int -> unsigned for 1 bit wide bitfields - we cannot have a value and a sign in 1 bit. Fixes some of the Intel C++ 8.0 warnings (-w1 level).
2003-12-28Fix more compiler warnings.Matthias Andree1-0/+1
2003-12-07Fix gcc -Wall nitpicksTheodore Ts'o1-13/+16
2003-11-21pass1.c (e2fsck_pass1), problem.h (PR_1_BB_FS_BLOCK), Theodore Ts'o1-18/+38
problem.c (PR_1_BB_FS_BLOCK, PR_1_BBINODE_BAD_METABLOCK_PROMPT): Fix up the handling of corrupted indirect blocks in the bad block. We now correctly handle the case where there is an overlap between a block group descriptor or a superblock and a bad block indirect block. In the case where the indirect block is corrupted, we now suggest "e2fsck -c".
2003-11-21Centeralize calculation of which blocks are reserved/used forTheodore Ts'o1-38/+3
the superblock and block group descriptors into two functions: ext2fs_reserve_super_and_bgd, found in lib/ext2fs/alloc_sb.c, and ext2fs_super_and_bgd_lock, found in lib/ext2fs/close.c. Change e2fsck/pass1.c (mark_table_blocks), lib/ext2fs/closefs.c (ext2fs_flush), lib/ext2fs/initialize.c (ext2fs_initialize), and misc/dumpe2fs.c (list_desc) to use these functions. e2fsck/ChangeLog pass1.c (mark_table_blocks): Use the new function ext2fs_reserve_super_and_bgd to calculate the blocks to be reserved. lib/ext2fs/ChangeLog closefs.c (ext2fs_super_and_bgd_loc): New function which centralizes the calculation of the superblock and block group descriptors. (ext2fs_flush): Use ext2fs_super_and_bgd_lock to figure out where to write the superblock and block group descriptors. alloc_sb.c (ext2fs_reserve_super_and_bgd): New function which reserves space in the block bitmap using ext2fs_super_and_bgd_loc. initialize.c (ext2fs_initialize): Use ext2fs_reserve_super_and_bgd to initialize the block bitmap. misc/ChangeLog dumpe2fs.c (list_desc): Use ext2fs_super_and_bgd_loc to determine the locations of the superblock and block group descriptors.
2003-08-01ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem() Theodore Ts'o1-5/+5
all now take a 'void *' instead of a 'void **' in order to avoid pointer aliasing problems with GCC 3.x.
2003-03-01Update debugfs and e2fsck to use the blkid library.Theodore Ts'o1-15/+0
2003-01-22pass1.c (check_blocks): Use the EXT2_I_SIZE macro.Theodore Ts'o1-1/+1
2002-11-08Change e2fsck to force out changes to the backup copies of theTheodore Ts'o1-0/+1
superblock and block group descriptors when important changes are made to those data structures.
2002-10-31pass1.c (e2fsck_pass1): Check the superblock write time to seeTheodore Ts'o1-1/+5
whether or not we can safely do the LOW_DTIME checks. (Addresses Sourceforge bug #620980)
2002-10-30Add support for the meta_bg feature flag to the resize2fs program.Theodore Ts'o1-2/+6
Fix bug in meta_bg support in mke2fs, e2fsck, and dumpe2fs; we were incorrectly reserving the legacy block groups desriptor blocks.
2002-10-20Add support for the meta_blockgroup filesystem format.Theodore Ts'o1-7/+25
2002-10-13Fix gcc -Wall nits.Theodore Ts'o1-0/+1
Fix format bug if NLS is in use. Add extra so that the info directory looks OK on OpenWall.
2002-10-03Handle BAD_BLOCK_IN_INODE_TABLE even at the beginning of theTheodore Ts'o1-28/+23
inode table, and shrink code by reorganizing the while loop so to eliminate duplicate calls to ext2fs_get_next_inode().
2002-08-17Update and clarify man pages (addresses Debian Bug #145044).Theodore Ts'o1-0/+1
Let e2fsck allow use of the TEA hash. Mke2fs will no longer abort if it can't zero blocks at the end of the filesystem. (Addresses Debian Bug #155007)
2002-08-17Overhaul extended attribute handling. Should now be correct withTheodore Ts'o1-40/+45
respect to the latest V2 bestbits ACL code.
2002-07-23pass1.c (e2fsck_pass1): If e2fsck is run with -n, don't createTheodore Ts'o1-1/+2
the dirs_to_hash list, since we don't want to reindex directories if the filesystem is opened read-only.
2002-07-20Add support to e2fsck to reindex directories to use hash trees.Theodore Ts'o1-1/+10
2002-06-26Add support for the half-MD4 HTREE hash.Theodore Ts'o1-21/+70
Add HTREE root node tests.
2002-06-25Add initial support for htree directories.Theodore Ts'o1-0/+16
2002-05-22Update to support the V2 Bestbits EA format.Theodore Ts'o1-5/+12
2002-05-21Check for inodes which are too big (either too many blocks, orTheodore Ts'o1-9/+16
would cause i_size to be too big), and offer to truncate the inode. Remove old bogus i_size checks. Add test case which tests e2fsck's handling of large sparse files. Older e2fsck with the old(er) bogus i_size checks didn't handle this correctly.
2002-05-21Fix up Andreas' changeset. Avoid use of dynamic automatic arrays,Theodore Ts'o1-12/+12
and check for EXT2_INDEX_FL for special devices, and consider them to be invalid if they are set.
2002-05-18Add more complete tests for symlinks: nul termination of long links and lengthAndreas Dilger1-13/+29
Improve the f_badsymlinks test case for these new tests.
2002-05-17Fix fencepost error in allocating space for array.Theodore Ts'o1-2/+3
2002-05-17Fix up Andreas's 8k blocksize changes to fix a number of bugs, Theodore Ts'o1-5/+2
and to make the page size determined at run-time instead of compile time.
2002-05-16Add support for creating and checking 8192-byte blocksize filesystems.Andreas Dilger1-16/+9
We complain if you try to create such a filesystem on a system with 4096 byte PAGE_SIZE. Add checks for valid inode size for undocumented -I option.
2001-12-16Fix various gcc -Wall nits. Fixed a bug in mke2fs where a bogusTheodore Ts'o1-1/+0
error message could be printed on an malloc() failure, and e2image was optimized to avoid needless system calls by using the stashed inode functions.
2001-08-30mke2fs.c (main): Zap the second sector of the disk, along withAndreas Dilger1-1/+1
any sectors in the same filesystem block after the superblock. The latter will remove (for example) swapspace signatures on 4kB+ blocksize filesystems. Also when zeroing the "end" of the filesystem don't actually zero the start of a very small device (less than 128kB).
2001-08-30pass1.c (e2fsck_pass1): For EXT2_RESIZE_INO, allow its i_mode toTheodore Ts'o1-0/+4
either be zero or a regular file (for compatibility with Andreas's on-line resizing programs).
2001-08-27Deal with libc5's lack of strnlen.Theodore Ts'o1-1/+16
Stop checking for strdup in the configure script since we don't care about that symbol.
2001-08-13e2fsck/pass1.c (e2fsck_pass1_check_device_inode): If i_blocks isTheodore Ts'o1-0/+5
non-zero, then assume that the device/socket/fifo inode is bogus.
2001-08-13pass1.c (check_size): Fix logic in check_size; the previous codeTheodore Ts'o1-6/+2
only offered to clear the inode size fields if both size and i_size_high were zero.
2001-08-09pass1.c, pass2.c, problem.c, problem.h: Fix bug introduced byTheodore Ts'o1-26/+1
Andreas's symlink code; check_blocks() was unconditionally testing inode_bad_map without checking to see if it existed first. Fixed problem a different way; we now no longer check inode_bad_map at all, since the file might not get deleted in pass 2 anyway. We move the large file feature reconciliation code to to e2fsck_pass2(), and in deallocate_inode() in pass2.c, we decrement the large files counter if we're about to delete a large file.
2001-08-04Cleanup changes to Andreas' symlink patch. Remove use of EXT2_LINK_DIRTheodore Ts'o1-16/+10
Also cleaned up the symlink handling code to make it a bit more compact and to test for a bad symlink block earlier.
2001-08-04Add extra checks for bad symlinks, including zero length symlinks,Andreas Dilger1-4/+45
too long i_size for slow and fast symlinks, i_size_high set, multiple blocks for slow symlinks.
2001-07-27pass1.c (e2fsck_pass1): Check for symlinks that have theTheodore Ts'o1-0/+1
immutable flag set (and offer to clear them).