linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Cc: Theodore Tso <tytso@mit.edu>
Subject: [PATCH] e2fsck: correct test for EOFBLOCKS
Date: Wed, 19 May 2010 13:20:13 -0500	[thread overview]
Message-ID: <4BF42BDD.9090301@redhat.com> (raw)

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>
---

Index: e2fsprogs-1.41.12/e2fsck/pass1.c
===================================================================
--- e2fsprogs-1.41.12.orig/e2fsck/pass1.c
+++ 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;


             reply	other threads:[~2010-05-19 18:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 18:20 Eric Sandeen [this message]
2010-05-19 19:08 ` [PATCH] e2fsck: correct test for EOFBLOCKS tytso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BF42BDD.9090301@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).