xfs: cross-reference the realtime bitmap
While we're scrubbing various btrees, cross-reference the records with the other metadata. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
@@ -98,3 +98,26 @@ xfs_scrub_rtsummary(
|
||||
/* XXX: implement this some day */
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
|
||||
/* xref check that the extent is not free in the rtbitmap */
|
||||
void
|
||||
xfs_scrub_xref_is_used_rt_space(
|
||||
struct xfs_scrub_context *sc,
|
||||
xfs_rtblock_t fsbno,
|
||||
xfs_extlen_t len)
|
||||
{
|
||||
bool is_free;
|
||||
int error;
|
||||
|
||||
xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
|
||||
error = xfs_rtalloc_extent_is_free(sc->mp, sc->tp, fsbno, len,
|
||||
&is_free);
|
||||
if (!xfs_scrub_should_check_xref(sc, &error, NULL))
|
||||
goto out_unlock;
|
||||
if (is_free)
|
||||
xfs_scrub_ino_xref_set_corrupt(sc, sc->mp->m_rbmip->i_ino,
|
||||
NULL);
|
||||
out_unlock:
|
||||
xfs_iunlock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
|
||||
}
|
||||
|
Reference in New Issue
Block a user