]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libfrog: add online scrub/repair for superblock counters
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 26 Sep 2019 17:41:35 +0000 (13:41 -0400)
committerEric Sandeen <sandeen@redhat.com>
Thu, 26 Sep 2019 17:41:35 +0000 (13:41 -0400)
Wire up the new superblock summary counter ioctls.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libfrog/scrub.c
libfrog/scrub.h
scrub/scrub.c

index 12c0926fbc60ed42eac0f4449a27ece9ac4b0276..e9671da2b7589da082011a338b4d6c239b70e5db 100644 (file)
@@ -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
index 6fda8975fbdcdc28c51dde0e1347405395ab3891..e43d8c244e48c89586d552884c20648150fcbe4e 100644 (file)
@@ -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);
index 153d29d55c78faee2c2711aa624e12c343eb36df..083ed9a1b7d192f34cccbd712cece43fedbcdaef 100644 (file)
@@ -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;