diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-05-21 17:08:09 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-08-10 09:58:09 -0700 |
commit | b3fb130b0df35eefd1df8ca7fc65db87d1c51a08 (patch) | |
tree | 99e5ab2785ffe330344858e8fe099f6149e0b658 | |
parent | de812ba016ab73370a90339a094530def8cf4fc3 (diff) |
xfs: cross-reference realtime bitmap to realtime rmapbt scrubber
When we're checking the realtime rmapbt, cross-reference the entries
with the realtime bitmap too.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r-- | fs/xfs/scrub/rtbitmap.c | 5 | ||||
-rw-r--r-- | fs/xfs/scrub/rtrmap.c | 14 |
2 files changed, 15 insertions, 4 deletions
diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c index c642bc206c41..6cbd3f6413e0 100644 --- a/fs/xfs/scrub/rtbitmap.c +++ b/fs/xfs/scrub/rtbitmap.c @@ -136,13 +136,10 @@ xchk_xref_is_used_rt_space( do_div(startext, sc->mp->m_sb.sb_rextsize); do_div(endext, sc->mp->m_sb.sb_rextsize); extcount = endext - startext + 1; - xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP); error = xfs_rtalloc_extent_is_free(sc->mp, sc->tp, startext, extcount, &is_free); if (!xchk_should_check_xref(sc, &error, NULL)) - goto out_unlock; + return; if (is_free) xchk_ino_xref_set_corrupt(sc, sc->mp->m_rbmip->i_ino); -out_unlock: - xfs_iunlock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP); } diff --git a/fs/xfs/scrub/rtrmap.c b/fs/xfs/scrub/rtrmap.c index 9b5d55734a41..458b71e5bae9 100644 --- a/fs/xfs/scrub/rtrmap.c +++ b/fs/xfs/scrub/rtrmap.c @@ -56,6 +56,16 @@ xchk_setup_rtrmapbt( /* Realtime reverse mapping. */ +/* Cross-reference with other metadata. */ +STATIC void +xchk_rtrmapbt_xref( + struct xfs_scrub *sc, + struct xfs_rmap_irec *irec) +{ + xchk_xref_is_used_rt_space(sc, irec->rm_startblock, + irec->rm_blockcount); +} + /* Scrub a realtime rmapbt record. */ STATIC int xchk_rtrmapbt_helper( @@ -86,6 +96,10 @@ xchk_rtrmapbt_helper( if (is_bmbt || non_inode || is_attr) xchk_btree_set_corrupt(bs->sc, bs->cur, 0); + if (bs->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) + goto out; + + xchk_rtrmapbt_xref(bs->sc, &irec); out: return error; } |