Blame SOURCES/xfsprogs-3.2.1-xfs_repair-fix-max-block-offset-test.patch

502773
[PATCH V2] xfs_repair: fix max block offset test
502773
502773
Eryu pointed out that in fstest xfs/071, we find corruption
502773
reported at the end.  This test attempts to do IO at the
502773
maximum possible offsets, and repair yields:
502773
502773
inode 1027 - extent offset too large - start 70, count 1, offset 2251799813685247
502773
correcting nextents for inode 1027
502773
bad data fork in inode 1027
502773
would have cleared inode 1027
502773
502773
Repair is complaining that an extent *starts* at the maximum
502773
block, but AFAICT, starting there is just fine, as long as
502773
we also end there.  i.e. a one-block extent at the limit
502773
is just fine.
502773
502773
So change the xfs_repair test to allow this situation.
502773
502773
Also, the warning text is a bit unclear, mixing in the physical
502773
block w/ the logical block... rearrange that a little to make
502773
it obvious.
502773
502773
Reported-by: Eryu Guan <eguan@redhat.com>
502773
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
502773
Reviewed-by: Brian Foster <bfoster@redhat.com>
502773
---
502773
502773
V2: Update the warning text
502773
502773
diff --git a/repair/dinode.c b/repair/dinode.c
502773
index 38a6562..59824ec 100644
502773
--- a/repair/dinode.c
502773
+++ b/repair/dinode.c
502773
@@ -667,12 +667,14 @@ _("inode %" PRIu64 " - bad extent overflows - start %" PRIu64 ", "
502773
 					irec.br_startoff);
502773
 				goto done;
502773
 		}
502773
-		if (irec.br_startoff >= fs_max_file_offset)  {
502773
+		/* Ensure this extent does not extend beyond the max offset */
502773
+		if (irec.br_startoff + irec.br_blockcount - 1 >
502773
+							fs_max_file_offset) {
502773
 			do_warn(
502773
-_("inode %" PRIu64 " - extent offset too large - start %" PRIu64 ", "
502773
-  "count %" PRIu64 ", offset %" PRIu64 "\n"),
502773
-				ino, irec.br_startblock, irec.br_blockcount,
502773
-				irec.br_startoff);
502773
+_("inode %" PRIu64 " - extent exceeds max offset - start %" PRIu64 ", "
502773
+  "count %" PRIu64 ", physical block %" PRIu64 "\n"),
502773
+				ino, irec.br_startoff, irec.br_blockcount,
502773
+				irec.br_startblock);
502773
 			goto done;
502773
 		}
502773
 
502773