From: Theodore Ts'o Date: Sat, 31 Mar 2007 22:56:09 +0000 (-0400) Subject: Fix edge case when i_size doesn't get fixed until second e2fsck run X-Git-Tag: E2FSPROGS-1_40~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=441ab1e02096e3c968cae6ddfde73140fcad8199;p=thirdparty%2Fe2fsprogs.git Fix edge case when i_size doesn't get fixed until second e2fsck run Don't assume that a special device is bogus just because i_blocks is non-zero. The i_blocks field could get adjusted later, and if this happens it will confuse the e2fsck_process_bad_inode() in pass 2. In practice true garbage inodes will have random non-zero in i_blocks[4..15], so there's no point doing the check for an illegal i_blocks value. Signed-off-by: "Theodore Ts'o" --- diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 93bb5f548..1ea3b1e7a 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,13 @@ +2007-03-31 Theodore Tso + + * pass1.c (e2fsck_pass1_check_device_inode): Don't assume that a + special device is bogus just because i_blocks is non-zero. + The i_blocks field could get adjusted later, and if this + happens it will confuse the e2fsck_process_bad_inode() in + pass 2. In practice true garbage inodes will have random + non-zero values in i_blocks[4..15], so there's no point + doing the check for an illegal i_blocks value. + 2007-03-28 Theodore Tso * pass1.c (e2fsck_pass1, check_ext_attr), diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 095f24436..9162b668b 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -133,11 +133,10 @@ int e2fsck_pass1_check_device_inode(ext2_filsys fs, struct ext2_inode *inode) int i; /* - * If i_blocks is non-zero, or the index flag is set, then - * this is a bogus device/fifo/socket + * If the index flag is set, then this is a bogus + * device/fifo/socket */ - if ((ext2fs_inode_data_blocks(fs, inode) != 0) || - (inode->i_flags & EXT2_INDEX_FL)) + if (inode->i_flags & EXT2_INDEX_FL) return 0; /*