]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: scrub the realtime group superblock
authorDarrick J. Wong <djwong@kernel.org>
Wed, 3 Jul 2024 21:22:04 +0000 (14:22 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 6 Aug 2024 12:53:50 +0000 (05:53 -0700)
Enable scrubbing of realtime group superblocks.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libfrog/scrub.c
libfrog/scrub.h
libxfs/xfs_fs.h
man/man2/ioctl_xfs_scrub_metadata.2
scrub/repair.c
scrub/scrub.c

index b2d58c7a966b0d630aeafb7ecbf51c6f897ac6e1..e7fb8b890bc133b5dacf0f5142e6a95d38e7bb61 100644 (file)
@@ -159,6 +159,11 @@ const struct xfrog_scrub_descr xfrog_scrubbers[XFS_SCRUB_TYPE_NR] = {
                .descr  = "metadata directory paths",
                .group  = XFROG_SCRUB_GROUP_METAPATH,
        },
+       [XFS_SCRUB_TYPE_RGSUPER] = {
+               .name   = "rgsuper",
+               .descr  = "realtime group superblock",
+               .group  = XFROG_SCRUB_GROUP_RTGROUP,
+       },
 };
 
 const struct xfrog_scrub_descr xfrog_metapaths[XFS_SCRUB_METAPATH_NR] = {
index a35d3e9c293fe5253e3b283b41bcef59a1c15ec0..83455c390e170a0fdd241a91ed8b88854ec1c524 100644 (file)
@@ -16,6 +16,7 @@ enum xfrog_scrub_group {
        XFROG_SCRUB_GROUP_ISCAN,        /* metadata requiring full inode scan */
        XFROG_SCRUB_GROUP_SUMMARY,      /* summary metadata */
        XFROG_SCRUB_GROUP_METAPATH,     /* metadata directory path */
+       XFROG_SCRUB_GROUP_RTGROUP,      /* per-rtgroup metadata */
 };
 
 /* Catalog of scrub types and names, indexed by XFS_SCRUB_TYPE_* */
index 06e8e18ad4c35017c86bfe0a109e686728d1bf9e..6f493ecf0da15cc38ebbdb153fb9d71eae4907f8 100644 (file)
@@ -736,9 +736,10 @@ struct xfs_scrub_metadata {
 #define XFS_SCRUB_TYPE_HEALTHY 27      /* everything checked out ok */
 #define XFS_SCRUB_TYPE_DIRTREE 28      /* directory tree structure */
 #define XFS_SCRUB_TYPE_METAPATH        29      /* metadata directory tree paths */
+#define XFS_SCRUB_TYPE_RGSUPER 30      /* realtime superblock */
 
 /* Number of scrub subcommands. */
-#define XFS_SCRUB_TYPE_NR      30
+#define XFS_SCRUB_TYPE_NR      31
 
 /*
  * This special type code only applies to the vectored scrub implementation.
index b1db740560d78b6b5a734a3c4edaebc092ca4774..13f655e2b97bbceaf6175907b72a4e9f50fb1ea9 100644 (file)
@@ -88,6 +88,15 @@ The allocation group number must be given in
 .BR sm_ino " and " sm_gen
 must be zero.
 
+.PP
+.TP
+.B XFS_SCRUB_TYPE_RGSUPER
+Examine a given realtime allocation group's superblock.
+The realtime allocation group number must be given in
+.IR sm_agno "."
+.IR sm_ino " and " sm_gen
+must be zero.
+
 .TP
 .B XFS_SCRUB_TYPE_INODE
 Examine a given inode record for obviously incorrect values and
index e594e704f51503cdb0a6f23648e19b9237c60a21..c8cdb98de5457ba884cef4521d87eb0f09a3724e 100644 (file)
@@ -546,6 +546,7 @@ repair_item_difficulty(
                case XFS_SCRUB_TYPE_REFCNTBT:
                case XFS_SCRUB_TYPE_RTBITMAP:
                case XFS_SCRUB_TYPE_RTSUM:
+               case XFS_SCRUB_TYPE_RGSUPER:
                        ret |= REPAIR_DIFFICULTY_PRIMARY;
                        break;
                }
index bcd63eea1030a6ea6edf19a4d6a72b424af3de24..855f4f8330b6c03c7b8bf2dbf55349bb92485d67 100644 (file)
@@ -107,6 +107,9 @@ format_scrubv_descr(
                return snprintf(buf, buflen, _("%s"), _(sc->descr));
        case XFROG_SCRUB_GROUP_METAPATH:
                return format_metapath_descr(buf, buflen, vhead);
+       case XFROG_SCRUB_GROUP_RTGROUP:
+               return snprintf(buf, buflen, _("rtgroup %u %s"),
+                               vhead->svh_agno, _(sc->descr));
        }
        return -1;
 }