xfs
[Top] [All Lists]

[PATCH] xfs_repair: fix agf limit error messages

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH] xfs_repair: fix agf limit error messages
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Tue, 19 Apr 2016 16:29:24 -0400
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.2
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@xxxxxxxxxx>
---

diff --git a/repair/agheader.c b/repair/agheader.c
index bd11ac2..b95cedd 100644
--- a/repair/agheader.c
+++ b/repair/agheader.c
@@ -94,7 +94,7 @@ verify_set_agf(xfs_mount_t *mp, xfs_agf_t *agf, 
xfs_agnumber_t i)
        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_t *agf, 
xfs_agnumber_t i)
        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);
        }

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] xfs_repair: fix agf limit error messages, Eric Sandeen <=