Blob Blame History Raw
commit 6aa32b47197828b6d014a6faf9c7450bbc16e66f
Author: Eric Sandeen <sandeen@redhat.com>
Date:   Tue May 10 17:16:06 2016 +1000

    xfs_repair: fix agf limit error messages
    
    Today we see errors like:
    
    "fllast 118 in agf 94 too large (max = 118)"
    
    which makes no sense.
    
    If we are erroring on X >= Y, Y is clearly not the maximum allowable
    value.
    
    Signed-off-by: Eric Sandeen <sandeen@redhat.com>
    Reviewed-by: Dave Chinner <dchinner@redhat.com>
    Signed-off-by: Dave Chinner <david@fromorbit.com>

Index: xfsprogs-4.5.0/repair/agheader.c
===================================================================
--- xfsprogs-4.5.0.orig/repair/agheader.c
+++ xfsprogs-4.5.0/repair/agheader.c
@@ -94,7 +94,7 @@ verify_set_agf(xfs_mount_t *mp, xfs_agf_
 	if (be32_to_cpu(agf->agf_flfirst) >= XFS_AGFL_SIZE(mp))  {
 		do_warn(_("flfirst %d in agf %d too large (max = %zu)\n"),
 			be32_to_cpu(agf->agf_flfirst),
-			i, XFS_AGFL_SIZE(mp));
+			i, XFS_AGFL_SIZE(mp) - 1);
 		if (!no_modify)
 			agf->agf_flfirst = cpu_to_be32(0);
 	}
@@ -102,7 +102,7 @@ verify_set_agf(xfs_mount_t *mp, xfs_agf_
 	if (be32_to_cpu(agf->agf_fllast) >= XFS_AGFL_SIZE(mp))  {
 		do_warn(_("fllast %d in agf %d too large (max = %zu)\n"),
 			be32_to_cpu(agf->agf_fllast),
-			i, XFS_AGFL_SIZE(mp));
+			i, XFS_AGFL_SIZE(mp) - 1);
 		if (!no_modify)
 			agf->agf_fllast = cpu_to_be32(0);
 	}