]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: scrub each rtgroup's portion of the rtbitmap separately
authorDarrick J. Wong <djwong@kernel.org>
Wed, 3 Jul 2024 21:22:04 +0000 (14:22 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 31 Jul 2024 01:46:51 +0000 (18:46 -0700)
Create a new scrub type code so that userspace can scrub each rtgroup's
portion of the rtbitmap file separately.  This reduces the long tail
latency that results from scanning the entire bitmap all at once, and
prepares us for future patchsets, wherein we'll need to be able to lock
a specific rtgroup so that we can rebuild that rtgroup's part of the
rtbitmap contents from the rtgroup's rmap btree.

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

index e7fb8b890bc133b5dacf0f5142e6a95d38e7bb61..351505f08ca91b8346cc982c5f75e5c9579f7f66 100644 (file)
@@ -164,6 +164,11 @@ const struct xfrog_scrub_descr xfrog_scrubbers[XFS_SCRUB_TYPE_NR] = {
                .descr  = "realtime group superblock",
                .group  = XFROG_SCRUB_GROUP_RTGROUP,
        },
+       [XFS_SCRUB_TYPE_RGBITMAP] = {
+               .name   = "rgbitmap",
+               .descr  = "realtime group bitmap",
+               .group  = XFROG_SCRUB_GROUP_RTGROUP,
+       },
 };
 
 const struct xfrog_scrub_descr xfrog_metapaths[XFS_SCRUB_METAPATH_NR] = {
index 0dfc277d664992387654163032b436037cb76d29..4a704432d924f8893d4bdb03e06b1d55d4113ea8 100644 (file)
@@ -737,9 +737,10 @@ struct xfs_scrub_metadata {
 #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 */
+#define XFS_SCRUB_TYPE_RGBITMAP        31      /* realtime group bitmap */
 
 /* Number of scrub subcommands. */
-#define XFS_SCRUB_TYPE_NR      31
+#define XFS_SCRUB_TYPE_NR      32
 
 /*
  * This special type code only applies to the vectored scrub implementation.
@@ -985,6 +986,7 @@ struct xfs_rtgroup_geometry {
        __u64 rg_reserved[13];  /* o: zero */
 };
 #define XFS_RTGROUP_GEOM_SICK_SUPER    (1U << 0)  /* superblock */
+#define XFS_RTGROUP_GEOM_SICK_BITMAP   (1U << 1)  /* rtbitmap for this group */
 
 /*
  * ioctl commands that are used by Linux filesystems
index f088406324f995d2f4dfee227c55778ec26f4c27..5a35d4e7b0f0aa0b2154b1adf2c9e96d8d32403b 100644 (file)
@@ -70,6 +70,7 @@ struct xfs_rtgroup;
 
 /* Observable health issues for realtime group metadata. */
 #define XFS_SICK_RG_SUPER      (1 << 0)  /* rt group superblock */
+#define XFS_SICK_RG_BITMAP     (1 << 1)  /* rt group part of rtbitmap */
 
 /* Observable health issues for AG metadata. */
 #define XFS_SICK_AG_SB         (1 << 0)  /* superblock */
@@ -116,7 +117,8 @@ struct xfs_rtgroup;
 #define XFS_SICK_RT_PRIMARY    (XFS_SICK_RT_BITMAP | \
                                 XFS_SICK_RT_SUMMARY)
 
-#define XFS_SICK_RG_PRIMARY    (XFS_SICK_RG_SUPER)
+#define XFS_SICK_RG_PRIMARY    (XFS_SICK_RG_SUPER | \
+                                XFS_SICK_RG_BITMAP)
 
 #define XFS_SICK_AG_PRIMARY    (XFS_SICK_AG_SB | \
                                 XFS_SICK_AG_AGF | \
index 13f655e2b97bbceaf6175907b72a4e9f50fb1ea9..dc439897c98888d2d1b50d1cb7b955819136ae1a 100644 (file)
@@ -97,6 +97,18 @@ The realtime allocation group number must be given in
 .IR sm_ino " and " sm_gen
 must be zero.
 
+.PP
+.TP
+.B XFS_SCRUB_TYPE_RGBITMAP
+Examine a given realtime allocation group's free space bitmap.
+Records are checked for obviously incorrect values and cross-referenced
+with other allocation group metadata records to ensure that there are no
+conflicts.
+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