]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: disable sb_frextents scrub/repair for zoned file systems
authorChristoph Hellwig <hch@lst.de>
Sun, 12 May 2024 05:39:45 +0000 (07:39 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 5 Nov 2024 08:29:52 +0000 (09:29 +0100)
Zoned file systems not only don't use the frextents counter, but the
in-memory percpu couner also includes reservations take before even
allocating delalloc extent records, so it will never match the per-zone
used information.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/fscounters.c
fs/xfs/scrub/fscounters_repair.c

index c2e55556f21ed0672e0e01cc3bec14f75e18941e..c5b7a1d46a510786296451b1130bc82cbf5ea0e5 100644 (file)
@@ -413,7 +413,13 @@ xchk_fscount_count_frextents(
 
        fsc->frextents = 0;
        fsc->frextents_delayed = 0;
-       if (!xfs_has_realtime(mp))
+
+       /*
+        * Don't bother verifying and repairing the fs counters for zoned file
+        * systems as they don't track an on-disk frextents count, and the
+        * in-memory percpu counter also includes reservations.
+        */
+       if (!xfs_has_realtime(mp) || xfs_has_zoned(mp))
                return 0;
 
        while ((rtg = xfs_rtgroup_next(mp, rtg))) {
@@ -597,13 +603,15 @@ xchk_fscounters(
                        try_again = true;
        }
 
-       if (!xchk_fscount_within_range(sc, frextents,
-                       &mp->m_free[FREE_RTEXTENTS],
-                       fsc->frextents - fsc->frextents_delayed)) {
-               if (fsc->frozen)
-                       xchk_set_corrupt(sc);
-               else
-                       try_again = true;
+       if (!xfs_has_zoned(mp)) {
+               if (!xchk_fscount_within_range(sc, frextents,
+                               &mp->m_free[FREE_RTEXTENTS],
+                               fsc->frextents - fsc->frextents_delayed)) {
+                       if (fsc->frozen)
+                               xchk_set_corrupt(sc);
+                       else
+                               try_again = true;
+               }
        }
 
        if (try_again)
index 08b6c7b5e1b7ea71729283c48c923cb82aac1ec1..e80d74f0c66f52cc759edc7ebc062967176ef0d5 100644 (file)
@@ -74,10 +74,12 @@ xrep_fscounters(
         * track of the delalloc reservations separately, as they are are
         * subtracted from m_frextents, but not included in sb_frextents.
         */
-       percpu_counter_set(&mp->m_free[FREE_RTEXTENTS],
-               fsc->frextents - fsc->frextents_delayed);
-       if (!xfs_has_rtgroups(mp))
-               mp->m_sb.sb_frextents = fsc->frextents;
+       if (!xfs_has_zoned(mp)) {
+               percpu_counter_set(&mp->m_free[FREE_RTEXTENTS],
+                       fsc->frextents - fsc->frextents_delayed);
+               if (!xfs_has_rtgroups(mp))
+                       mp->m_sb.sb_frextents = fsc->frextents;
+       }
 
        return 0;
 }