[PATCH 04/22] libfrog: enable scrubbing of the realtime refcount data

Darrick J. Wong
2025-02-06T22:57:49Z

Add a new entry so that we can scrub the rtrefcountbt and its metadata
directory tree path.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
libfrog/scrub.c | 10 ++++++++++
scrub/repair.c | 1 +
2 files changed, 11 insertions(+)

diff --git a/libfrog/scrub.c b/libfrog/scrub.c
index 11d467666d6b5a..9ffe4698e864ab 100644
--- a/libfrog/scrub.c
+++ b/libfrog/scrub.c
@@ -169,6 +169,11 @@ const struct xfrog_scrub_descr xfrog_scrubbers[XFS_SCRUB_TYPE_NR] = {
.descr = "realtime reverse mapping btree",
.group = XFROG_SCRUB_GROUP_RTGROUP,
},
+ [XFS_SCRUB_TYPE_RTREFCBT] = {
+ .name = "rtrefcountbt",
+ .descr = "realtime reference count btree",
+ .group = XFROG_SCRUB_GROUP_RTGROUP,
+ },
};

const struct xfrog_scrub_descr xfrog_metapaths[XFS_SCRUB_METAPATH_NR] = {
@@ -217,6 +222,11 @@ const struct xfrog_scrub_descr xfrog_metapaths[XFS_SCRUB_METAPATH_NR] = {
.descr = "rtgroup rmap btree",
.group = XFROG_SCRUB_GROUP_RTGROUP,
},
+ [XFS_SCRUB_METAPATH_RTREFCOUNTBT] = {
+ .name = "rtrefcbt",
+ .descr = "rtgroup refcount btree",
+ .group = XFROG_SCRUB_GROUP_RTGROUP,
+ },
};

/* Invoke the scrub ioctl. Returns zero or negative error code. */
diff --git a/scrub/repair.c b/scrub/repair.c
index e6906cbd37d0b3..b2c4232fe8cea1 100644
--- a/scrub/repair.c
+++ b/scrub/repair.c
@@ -548,6 +548,7 @@ repair_item_difficulty(
case XFS_SCRUB_TYPE_RTBITMAP:
case XFS_SCRUB_TYPE_RTSUM:
case XFS_SCRUB_TYPE_RGSUPER:
+ case XFS_SCRUB_TYPE_RTREFCBT:
ret |= REPAIR_DIFFICULTY_PRIMARY;
break;
}