]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_scrub: warn about difficult rtgroup repairs
authorDarrick J. Wong <djwong@kernel.org>
Wed, 24 Jun 2026 18:17:22 +0000 (11:17 -0700)
committerAndrey Albershteyn <aalbersh@kernel.org>
Thu, 25 Jun 2026 13:42:53 +0000 (15:42 +0200)
Codex noticed that rtgroup metadata repairs can be difficult (e.g.
rtrmap) but we don't ever warn the user about that.  Scrub does that for
per-AG and fs metadata, so do that here too.

Cc: linux-xfs@vger.kernel.org # v6.13.0
Fixes: 241d915d69d4ae ("xfs_scrub: scrub realtime allocation group metadata")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
scrub/phase2.c

index 8de77429f05d60981d63724dcc47bc30ed68ced6..f382c1367be4745688f4ac4dfcd19eee8064a569 100644 (file)
@@ -251,6 +251,7 @@ scan_rtgroup_metadata(
        struct scrub_ctx        *ctx = (struct scrub_ctx *)wq->wq_ctx;
        struct scan_ctl         *sctl = arg;
        char                    descr[DESCR_BUFSZ];
+       unsigned int            difficulty;
        bool                    defer_repairs;
        int                     ret;
 
@@ -281,7 +282,14 @@ scan_rtgroup_metadata(
                sctl->aborted = true;
                return;
        }
+       if (defer_repairs)
+               goto defer;
+
+       /* Complain about metadata corruptions that might not be fixable. */
+       difficulty = repair_item_difficulty(&sri);
+       warn_repair_difficulties(ctx, difficulty, descr);
 
+defer:
        /* Everything else gets fixed during phase 4. */
        ret = defer_fs_repair(ctx, &sri);
        if (ret) {