From ab0585861f60338fa2c00a9baeaa03eabdaf539f Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 4 Feb 2025 15:48:04 +0100 Subject: [PATCH] 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 --- fs/xfs/scrub/fscounters.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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); } -- 2.50.1