Skip to contentSkip to conversation

e2fsprogs-i_size-corruption.patch

PATCH In review Kalpak Shah 1 participant 1 message Oct 6, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 13/15 e2fsprogs-i_size-corruption.patch

Fix handling of block preallocation support in cases where the kernel PAGE_SIZE is larger than the filesystem blocksize.

Fix handling of block preallocation support in cases where the kernel PAGE_SIZE is larger than the filesystem blocksize.

e2fsck/pass1.c +1 -1
Index: e2fsprogs-1.40.2/e2fsck/pass1.c
===================================================================
@@ -2103,7 +2103,7 @@ static void check_blocks(e2fsck_t ctx, s
 		if ((pb.last_block >= 0) &&
 		    /* allow allocated blocks to end of PAGE_SIZE */
 		    (size < (__u64)pb.last_block * fs->blocksize) &&
-		    (pb.last_block / blkpg * blkpg != pb.last_block ||
+		    ((pb.last_block+1) / blkpg * blkpg != (pb.last_block+1) ||
 		     size < (__u64)(pb.last_block & ~(blkpg-1)) *fs->blocksize))
 			bad_size = 3;
 		else if (size > ext2_max_sizes[fs->super->s_log_block_size])