Blob Blame History Raw
From: Eric Sandeen <sandeen@redhat.com>
Date: Wed, 19 May 2010 18:20:13 +0000 (-0500)
Subject: e2fsck: correct test for EOFBLOCKS
X-Git-Url: http://git.kernel.org/?p=fs%2Fext2%2Fe2fsprogs.git;a=commitdiff_plain;h=ae2272f8459f75c064b2644320db4ec5213d40a9

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.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---

diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index c35937f..4bf80d2 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -2013,7 +2013,7 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx,
 		 * 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;