Skip to contentSkip to conversation

e2fsck: correct test for EOFBLOCKS

PATCH In review Eric Sandeen 2 participants 2 messages May 19, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e2fsck: correct test for EOFBLOCKS

This test, added to e2fsprogs-1.41.12, is backwards.

If EOFBLOCKS is set, then the size -should- be less than the last physical block...

xfstests 013 caught this.

---

e2fsck/pass1.c +1 -1
Index: e2fsprogs-1.41.12/e2fsck/pass1.c
===================================================================
@@ -2013,7 +2013,7 @@ static void check_blocks(e2fsck_t ctx, s
 		 * doesn't need to be.
 		 */
 		if ((inode->i_flags & EXT4_EOFBLOCKS_FL) &&
-		    (size <= (((__u64)pb.last_block + 1) * fs->blocksize))) {
+		    (size >= (((__u64)pb.last_block + 1) * fs->blocksize))) {
 			pctx->blkcount = pb.last_block;
 			if (fix_problem(ctx, PR_1_EOFBLOCKS_FL_SET, pctx)) {
 				inode->i_flags &= ~EXT4_EOFBLOCKS_FL;
#1 lore raw
Quoted 8 lines · Eric Sandeen

This test, added to e2fsprogs-1.41.12, is backwards.

If EOFBLOCKS is set, then the size -should- be less than the last physical block...

xfstests 013 caught this.

Oops, *blush*. Applied and pushed out.

There will likely be a 1.41.13 happening next week. Let me know ASAP if there are any other mistakes or patches that you think should go in to the release.

- Ted