diff mbox

[19/20] xfs: cross-reference realtime bitmap to realtime rmapbt scrubber

Message ID 147216872624.3688.9023416667706304844.stgit@birch.djwong.org
State Superseded
Headers show

Commit Message

Darrick J. Wong Aug. 25, 2016, 11:45 p.m. UTC
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>
---
 fs/xfs/xfs_scrub.c |    8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox

Patch

diff --git a/fs/xfs/xfs_scrub.c b/fs/xfs/xfs_scrub.c
index f1f4a2f..f0cd21f 100644
--- a/fs/xfs/xfs_scrub.c
+++ b/fs/xfs/xfs_scrub.c
@@ -2845,10 +2845,12 @@  xfs_scrub_rtrmapbt_helper(
 {
 	struct xfs_mount		*mp = bs->cur->bc_mp;
 	struct xfs_rmap_irec		irec;
+	bool				is_free;
 	bool				non_inode;
 	bool				is_bmbt;
 	bool				is_attr;
 	int				error;
+	int				err2;
 
 	error = xfs_rmap_btrec_to_irec(bs->cur, rec, &irec);
 	if (error)
@@ -2868,6 +2870,12 @@  xfs_scrub_rtrmapbt_helper(
 	XFS_BTREC_SCRUB_CHECK(bs, !non_inode);
 	XFS_BTREC_SCRUB_CHECK(bs, !is_attr);
 
+	/* Check the rtbitmap thinks it's free. */
+	err2 = xfs_rtbitmap_extent_is_free(mp, irec.rm_startblock,
+			irec.rm_blockcount, &is_free);
+	if (!err2)
+		XFS_BTREC_SCRUB_CHECK(bs, !is_free);
+
 	return error;
 }