Thread (20 messages) 20 messages, 1 author, 2017-08-31
STALE3241d

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

From: Darrick J. Wong <hidden>
Date: 2017-08-31 20:35:27
Subsystem: filesystems (vfs and infrastructure), the rest, xfs filesystem · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds, Carlos Maiolino

From: Darrick J. Wong <redacted>

When we're checking the realtime rmapbt, cross-reference the entries
with the realtime bitmap too.

Signed-off-by: Darrick J. Wong <redacted>
---
 fs/xfs/scrub/rtrmap.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/xfs/scrub/rtrmap.c b/fs/xfs/scrub/rtrmap.c
index 1480ea6..6862b54 100644
--- a/fs/xfs/scrub/rtrmap.c
+++ b/fs/xfs/scrub/rtrmap.c
@@ -33,6 +33,8 @@
 #include "xfs_rmap_btree.h"
 #include "xfs_rtrmap_btree.h"
 #include "xfs_inode.h"
+#include "xfs_alloc.h"
+#include "xfs_rtalloc.h"
 #include "scrub/xfs_scrub.h"
 #include "scrub/scrub.h"
 #include "scrub/common.h"
@@ -78,6 +80,7 @@ xfs_scrub_rtrmapbt_helper(
 	struct xfs_mount		*mp = bs->cur->bc_mp;
 	struct xfs_rmap_irec		irec;
 	unsigned long long		rec_end;
+	bool				is_free;
 	bool				non_inode;
 	bool				is_bmbt;
 	bool				is_attr;
@@ -99,6 +102,12 @@ xfs_scrub_rtrmapbt_helper(
 	xfs_scrub_btree_check_ok(bs->sc, bs->cur, 0,
 			!is_bmbt && !non_inode && !is_attr);
 
+	/* Check the rtbitmap thinks it's free. */
+	error = xfs_rtalloc_extent_is_free(mp, bs->cur->bc_tp,
+			irec.rm_startblock, irec.rm_blockcount, &is_free);
+	if (xfs_scrub_should_xref(bs->sc, &error, NULL))
+		xfs_scrub_btree_xref_check_ok(bs->sc, bs->cur, 0, !is_free);
+
 out:
 	return error;
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help