From: Darrick J. Wong Date: Thu, 26 Sep 2019 17:41:35 +0000 (-0400) Subject: libfrog: add online scrub/repair for superblock counters X-Git-Tag: v5.3.0-rc2~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8dd3922c425e3036cebe53bbcd73aec971983d5e;p=thirdparty%2Fxfsprogs-dev.git 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 --- 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;