]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: always freeze the fs when checking fs counters xfs-freecounter-dbg
authorChristoph Hellwig <hch@lst.de>
Tue, 4 Feb 2025 14:48:04 +0000 (15:48 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 4 Feb 2025 14:49:26 +0000 (15:49 +0100)
Otherwise we can't guarantee that the delalloc and free space counters
are in sync.

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

index f7258544848fcdfe1d854dbdca23637c190cbf8b..97631b8128d4d195f446f883ae4b9d5cd6471ed1 100644 (file)
@@ -231,11 +231,9 @@ xchk_setup_fscounters(
         * This requires the fs to be frozen, which will disable background
         * reclaim and purge all inactive inodes.
         */
-       if ((sc->flags & XCHK_TRY_HARDER) || xchk_could_repair(sc)) {
-               error = xchk_fscounters_freeze(sc);
-               if (error)
-                       return error;
-       }
+       error = xchk_fscounters_freeze(sc);
+       if (error)
+               return error;
 
        return xchk_trans_alloc_empty(sc);
 }