diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-01-17 05:53:06 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-01-18 08:00:45 +0300 |
commit | 52dc4b44af74196ded6413304542ead0257b5cda (patch) | |
tree | f5896fc577ede48201cefa0ae25b5ae28113c147 /fs/xfs/scrub/bmap.c | |
parent | 166d76410d7ac08ba2fd90f33ebb545e21fd6b3a (diff) | |
download | linux-52dc4b44af74196ded6413304542ead0257b5cda.tar.xz |
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/bmap.c')
-rw-r--r-- | fs/xfs/scrub/bmap.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c index b6931928e727..7e8e239c2516 100644 --- a/fs/xfs/scrub/bmap.c +++ b/fs/xfs/scrub/bmap.c @@ -119,8 +119,27 @@ xfs_scrub_bmap_extent_xref( struct xfs_btree_cur *cur, struct xfs_bmbt_irec *irec) { + struct xfs_mount *mp = info->sc->mp; + xfs_agnumber_t agno; + xfs_agblock_t agbno; + xfs_extlen_t len; + int error; + if (info->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) return; + + agno = XFS_FSB_TO_AGNO(mp, irec->br_startblock); + agbno = XFS_FSB_TO_AGBNO(mp, irec->br_startblock); + len = irec->br_blockcount; + + error = xfs_scrub_ag_init(info->sc, agno, &info->sc->sa); + if (!xfs_scrub_fblock_process_error(info->sc, info->whichfork, + irec->br_startoff, &error)) + return; + + xfs_scrub_xref_is_used_space(info->sc, agbno, len); + + xfs_scrub_ag_free(info->sc, &info->sc->sa); } /* Scrub a single extent record. */ |