]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: repair realtime group superblock
authorDarrick J. Wong <djwong@kernel.org>
Wed, 29 May 2024 04:11:23 +0000 (21:11 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 6 Aug 2024 13:05:17 +0000 (06:05 -0700)
Repair the realtime superblock if it has become out of date with the
primary superblock.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/scrub/repair.h
fs/xfs/scrub/rgsuper.c
fs/xfs/scrub/scrub.c

index e8ccfe8008e0ef9741df98581fc4790e70b485e8..ab126fd6bb6eaee7dbfb907bd850e50981e7bb9f 100644 (file)
@@ -148,9 +148,11 @@ int xrep_metapath(struct xfs_scrub *sc);
 #ifdef CONFIG_XFS_RT
 int xrep_rtbitmap(struct xfs_scrub *sc);
 int xrep_rtsummary(struct xfs_scrub *sc);
+int xrep_rgsuperblock(struct xfs_scrub *sc);
 #else
 # define xrep_rtbitmap                 xrep_notsupported
 # define xrep_rtsummary                        xrep_notsupported
+# define xrep_rgsuperblock             xrep_notsupported
 #endif /* CONFIG_XFS_RT */
 
 #ifdef CONFIG_XFS_QUOTA
@@ -255,6 +257,7 @@ static inline int xrep_setup_symlink(struct xfs_scrub *sc, unsigned int *x)
 #define xrep_symlink                   xrep_notsupported
 #define xrep_dirtree                   xrep_notsupported
 #define xrep_metapath                  xrep_notsupported
+#define xrep_rgsuperblock              xrep_notsupported
 
 #endif /* CONFIG_XFS_ONLINE_REPAIR */
 
index cb2c6ee97b77e926aba542de9dddffa66ab4f4f7..d695c43e488763eb522ceee1ebec3833592ed657 100644 (file)
 #include "xfs_trans_resv.h"
 #include "xfs_mount.h"
 #include "xfs_rtgroup.h"
+#include "xfs_log_format.h"
+#include "xfs_trans.h"
+#include "xfs_sb.h"
 #include "scrub/scrub.h"
 #include "scrub/common.h"
+#include "scrub/repair.h"
 
 /* Set us up with a transaction and an empty context. */
 int
@@ -70,3 +74,15 @@ xchk_rgsuperblock(
        xchk_rgsuperblock_xref(sc);
        return 0;
 }
+
+#ifdef CONFIG_XFS_ONLINE_REPAIR
+int
+xrep_rgsuperblock(
+       struct xfs_scrub        *sc)
+{
+       ASSERT(sc->sr.rtg->rtg_rgno == 0);
+
+       xfs_log_sb(sc->tp);
+       return 0;
+}
+#endif /* CONFIG_XFS_ONLINE_REPAIR */
index ec59e601b66cfdd3c0fe5ebed1e3c7128e968673..f942141c65398419f66aeedc6d3c129bff4a3182 100644 (file)
@@ -456,7 +456,7 @@ static const struct xchk_meta_ops meta_scrub_ops[] = {
                .setup  = xchk_setup_rgsuperblock,
                .scrub  = xchk_rgsuperblock,
                .has    = xfs_has_rtsb,
-               .repair = xrep_notsupported,
+               .repair = xrep_rgsuperblock,
        },
 };