diff mbox series

[8/9] xfs_repair: directly compare refcount records

Message ID 160503143411.1201232.10096865635977108103.stgit@magnolia (mailing list archive)
State Accepted, archived
Headers show
Series xfsprogs: fixes for 5.10 | expand

Commit Message

Darrick J. Wong Nov. 10, 2020, 6:03 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Check that our observed refcount records have exact matches for what's
in the ondisk refcount btree, since they're supposed to match exactly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 repair/rmap.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christoph Hellwig Nov. 10, 2020, 6:37 p.m. UTC | #1
On Tue, Nov 10, 2020 at 10:03:54AM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Check that our observed refcount records have exact matches for what's
> in the ondisk refcount btree, since they're supposed to match exactly.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/repair/rmap.c b/repair/rmap.c
index a4cc6a4937c9..54451a7e262d 100644
--- a/repair/rmap.c
+++ b/repair/rmap.c
@@ -1402,8 +1402,8 @@  _("Missing reference count record for (%u/%u) len %u count %u\n"),
 
 		/* Compare each refcount observation against the btree's */
 		if (tmp.rc_startblock != rl_rec->rc_startblock ||
-		    tmp.rc_blockcount < rl_rec->rc_blockcount ||
-		    tmp.rc_refcount < rl_rec->rc_refcount)
+		    tmp.rc_blockcount != rl_rec->rc_blockcount ||
+		    tmp.rc_refcount != rl_rec->rc_refcount)
 			do_warn(
 _("Incorrect reference count: saw (%u/%u) len %u nlinks %u; should be (%u/%u) len %u nlinks %u\n"),
 				agno, tmp.rc_startblock, tmp.rc_blockcount,