public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs_repair: fix max block offset test
@ 2014-12-11 17:54 Eric Sandeen
  2014-12-18 15:18 ` Brian Foster
  2014-12-19 19:58 ` [PATCH V2] " Eric Sandeen
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Sandeen @ 2014-12-11 17:54 UTC (permalink / raw)
  To: xfs-oss; +Cc: Eryu Guan

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.

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

diff --git a/repair/dinode.c b/repair/dinode.c
index 38a6562..ca57a61 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -667,7 +667,9 @@ _("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"),

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-12-19 20:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH V2] " Eric Sandeen
2014-12-19 20:31   ` Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox