summaryrefslogtreecommitdiffstats
path: root/fs/xfs/scrub/inode.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-01-16 18:53:06 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2018-01-17 21:00:45 -0800
commit52dc4b44af74196ded6413304542ead0257b5cda (patch)
treef5896fc577ede48201cefa0ae25b5ae28113c147 /fs/xfs/scrub/inode.c
parent166d76410d7ac08ba2fd90f33ebb545e21fd6b3a (diff)
downloadlinux-52dc4b44af74196ded6413304542ead0257b5cda.tar.bz2
xfs: cross-reference with the bnobt
When we're scrubbing various btrees, cross-reference the records with the bnobt to ensure that we don't also think the space is free. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/inode.c')
-rw-r--r--fs/xfs/scrub/inode.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/xfs/scrub/inode.c b/fs/xfs/scrub/inode.c
index 63525791b3ce..153d4eb91b93 100644
--- a/fs/xfs/scrub/inode.c
+++ b/fs/xfs/scrub/inode.c
@@ -584,8 +584,23 @@ xfs_scrub_inode_xref(
xfs_ino_t ino,
struct xfs_dinode *dip)
{
+ xfs_agnumber_t agno;
+ xfs_agblock_t agbno;
+ int error;
+
if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
return;
+
+ agno = XFS_INO_TO_AGNO(sc->mp, ino);
+ agbno = XFS_INO_TO_AGBNO(sc->mp, ino);
+
+ error = xfs_scrub_ag_init(sc, agno, &sc->sa);
+ if (!xfs_scrub_xref_process_error(sc, agno, agbno, &error))
+ return;
+
+ xfs_scrub_xref_is_used_space(sc, agbno, 1);
+
+ xfs_scrub_ag_free(sc, &sc->sa);
}
/* Scrub an inode. */