All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Eric Sandeen <sandeen@redhat.com>, xfs-oss <xfs@oss.sgi.com>
Cc: Eryu Guan <eguan@redhat.com>
Subject: [PATCH V2] xfs_repair: fix max block offset test
Date: Fri, 19 Dec 2014 13:58:26 -0600	[thread overview]
Message-ID: <54948362.9070406@sandeen.net> (raw)
In-Reply-To: <5489DA3B.5050908@redhat.com>

Eryu pointed out that in fstest xfs/071, we find corruption
reported at the end.  This test attempts to do IO at the
maximum possible offsets, and repair yields:

inode 1027 - extent offset too large - start 70, count 1, offset 2251799813685247
correcting nextents for inode 1027
bad data fork in inode 1027
would have cleared inode 1027

Repair is complaining that an extent *starts* at the maximum
block, but AFAICT, starting there is just fine, as long as
we also end there.  i.e. a one-block extent at the limit
is just fine.

So change the xfs_repair test to allow this situation.

Also, the warning text is a bit unclear, mixing in the physical
block w/ the logical block... rearrange that a little to make
it obvious.

Reported-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: Update the warning text

diff --git a/repair/dinode.c b/repair/dinode.c
index 38a6562..59824ec 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -667,12 +667,14 @@ _("inode %" PRIu64 " - bad extent overflows - start %" PRIu64 ", "
 					irec.br_startoff);
 				goto done;
 		}
-		if (irec.br_startoff >= fs_max_file_offset)  {
+		/* Ensure this extent does not extend beyond the max offset */
+		if (irec.br_startoff + irec.br_blockcount - 1 >
+							fs_max_file_offset) {
 			do_warn(
-_("inode %" PRIu64 " - extent offset too large - start %" PRIu64 ", "
-  "count %" PRIu64 ", offset %" PRIu64 "\n"),
-				ino, irec.br_startblock, irec.br_blockcount,
-				irec.br_startoff);
+_("inode %" PRIu64 " - extent exceeds max offset - start %" PRIu64 ", "
+  "count %" PRIu64 ", physical block %" PRIu64 "\n"),
+				ino, irec.br_startoff, irec.br_blockcount,
+				irec.br_startblock);
 			goto done;
 		}
 


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2014-12-19 19:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11 17:54 [PATCH] xfs_repair: fix max block offset test Eric Sandeen
2014-12-18 15:18 ` Brian Foster
2014-12-18 16:43   ` Eric Sandeen
2014-12-19 18:54   ` Eric Sandeen
2014-12-19 20:26     ` Brian Foster
2014-12-19 19:58 ` Eric Sandeen [this message]
2014-12-19 20:31   ` [PATCH V2] " Brian Foster

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=54948362.9070406@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=eguan@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=xfs@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.