From: Christoph Hellwig Date: Tue, 4 Feb 2025 14:48:04 +0000 (+0100) Subject: xfs: always freeze the fs when checking fs counters X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Fxfs-freecounter-dbg;p=users%2Fhch%2Fxfs.git xfs: always freeze the fs when checking fs counters Otherwise we can't guarantee that the delalloc and free space counters are in sync. Signed-off-by: Christoph Hellwig --- diff --git a/fs/xfs/scrub/fscounters.c b/fs/xfs/scrub/fscounters.c index f7258544848f..97631b8128d4 100644 --- a/fs/xfs/scrub/fscounters.c +++ b/fs/xfs/scrub/fscounters.c @@ -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); }