From 8dd3922c425e3036cebe53bbcd73aec971983d5e Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 26 Sep 2019 13:41:35 -0400 Subject: [PATCH] libfrog: add online scrub/repair for superblock counters Wire up the new superblock summary counter ioctls. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Eric Sandeen --- libfrog/scrub.c | 6 ++++++ libfrog/scrub.h | 7 +++++++ scrub/scrub.c | 2 ++ 3 files changed, 15 insertions(+) diff --git a/libfrog/scrub.c b/libfrog/scrub.c index 12c0926fb..e9671da2b 100644 --- a/libfrog/scrub.c +++ b/libfrog/scrub.c @@ -129,6 +129,12 @@ const struct xfrog_scrub_descr xfrog_scrubbers[XFS_SCRUB_TYPE_NR] = { .descr = "project quotas", .type = XFROG_SCRUB_TYPE_FS, }, + [XFS_SCRUB_TYPE_FSCOUNTERS] = { + .name = "fscounters", + .descr = "filesystem summary counters", + .type = XFROG_SCRUB_TYPE_FS, + .flags = XFROG_SCRUB_DESCR_SUMMARY, + }, }; int diff --git a/libfrog/scrub.h b/libfrog/scrub.h index 6fda8975f..e43d8c244 100644 --- a/libfrog/scrub.h +++ b/libfrog/scrub.h @@ -20,8 +20,15 @@ struct xfrog_scrub_descr { const char *name; const char *descr; enum xfrog_scrub_type type; + unsigned int flags; }; +/* + * The type of metadata checked by this scrubber is a summary of other types + * of metadata. This scrubber should be run after all the others. + */ +#define XFROG_SCRUB_DESCR_SUMMARY (1 << 0) + extern const struct xfrog_scrub_descr xfrog_scrubbers[XFS_SCRUB_TYPE_NR]; int xfrog_scrub_metadata(struct xfs_fd *xfd, struct xfs_scrub_metadata *meta); diff --git a/scrub/scrub.c b/scrub/scrub.c index 153d29d55..083ed9a1b 100644 --- a/scrub/scrub.c +++ b/scrub/scrub.c @@ -293,6 +293,8 @@ xfs_scrub_metadata( for (type = 0; type < XFS_SCRUB_TYPE_NR; type++, sc++) { if (sc->type != scrub_type) continue; + if (sc->flags & XFROG_SCRUB_DESCR_SUMMARY) + continue; meta.sm_type = type; meta.sm_flags = 0; -- 2.47.3