size = EXT2_I_SIZE(inode);
if ((pb.last_init_lblock >= 0) &&
- /* if size is smaller than expected by the block count,
- * allow allocated blocks to end of PAGE_SIZE.
- * last_init_lblock is the last in-use block, so it is
- * the minimum expected file size, but +1 because it is
- * the base-zero block number and not the block count. */
- (size < (__u64)pb.last_init_lblock * fs->blocksize) &&
- ((pb.last_init_lblock + 1) / blkpg * blkpg !=
- (pb.last_init_lblock + 1) ||
- size < (__u64)(pb.last_init_lblock & ~(blkpg - 1)) *
- fs->blocksize))
+ /* Do not allow initialized allocated blocks past i_size*/
+ (size < (__u64)pb.last_init_lblock * fs->blocksize))
bad_size = 3;
else if (!(extent_fs && (inode->i_flags & EXT4_EXTENTS_FL)) &&
size > ext2_max_sizes[fs->super->s_log_block_size])
Pass 1: Checking inodes, blocks, and sizes
+Inode 30, i_size is 2048, should be 4096. Fix? yes
+
Inode 31, i_size is 2048, should be 6144. Fix? yes
Pass 2: Checking directory structure
+++ /dev/null
-Pass 1: Checking inodes, blocks, and sizes
-Pass 2: Checking directory structure
-Pass 3: Checking directory connectivity
-Pass 4: Checking reference counts
-Pass 5: Checking group summary information
-test_filesys: 12/32 files (0.0% non-contiguous), 40/100 blocks
-Exit status is 0
+++ /dev/null
-Pass 1: Checking inodes, blocks, and sizes
-Pass 2: Checking directory structure
-Pass 3: Checking directory connectivity
-Pass 4: Checking reference counts
-Pass 5: Checking group summary information
-test_filesys: 12/32 files (0.0% non-contiguous), 40/100 blocks
-Exit status is 0
+++ /dev/null
-PAGE_SIZE larger than blocksize with hole at end
+++ /dev/null
-SKIP_GUNZIP="true"
-
-touch $TMPFILE
-$MKE2FS -N 32 -F -o Linux -b 1024 $TMPFILE 100 > /dev/null 2>&1
-
-DATA_FILE=$(mktemp ${TMPDIR:-/tmp}/e2fsprogs-zerodata.XXXXXX)
-dd if=$TEST_BITS of=$DATA_FILE bs=1k count=16 > /dev/null 2>&1
-$DEBUGFS -w $TMPFILE << EOF > /dev/null 2>&1
-write $DATA_FILE foo
-set_inode_field foo size 13000
-q
-EOF
-
-. $cmd_dir/run_e2fsck
-
-rm -f $DATA_FILE
-
-unset DATA_FILE