aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/scrub
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-10-26 14:16:36 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-10-31 08:58:21 -0700
commitf62ac3e0ac33d366fe81e194fee81de9be2cd886 (patch)
tree24f6eb1e62e928d76786f3f9a33bd146abc0d3cc /fs/xfs/scrub
parentxfs: remove XFS_FIND_RCEXT_SHARED and _COW (diff)
downloadlinux-dev-f62ac3e0ac33d366fe81e194fee81de9be2cd886.tar.xz
linux-dev-f62ac3e0ac33d366fe81e194fee81de9be2cd886.zip
xfs: check record domain when accessing refcount records
Now that we've separated the startblock and CoW/shared extent domain in the incore refcount record structure, check the domain whenever we retrieve a record to ensure that it's still in the domain that we want. Depending on the circumstances, a change in domain either means we're done processing or that we've found a corruption and need to fail out. The refcount check in xchk_xref_is_cow_staging is redundant since _get_rec has done that for a long time now, so we can get rid of it. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r--fs/xfs/scrub/refcount.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/scrub/refcount.c b/fs/xfs/scrub/refcount.c
index fe5ffe4f478d..a26ee0f24ef2 100644
--- a/fs/xfs/scrub/refcount.c
+++ b/fs/xfs/scrub/refcount.c
@@ -439,8 +439,8 @@ xchk_xref_is_cow_staging(
return;
}
- /* CoW flag must be set, refcount must be 1. */
- if (rc.rc_domain != XFS_REFC_DOMAIN_COW || rc.rc_refcount != 1)
+ /* CoW lookup returned a shared extent record? */
+ if (rc.rc_domain != XFS_REFC_DOMAIN_COW)
xchk_btree_xref_set_corrupt(sc, sc->sa.refc_cur, 0);
/* Must be at least as long as what was passed in */