summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-09-01 11:18:02 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-12-15 17:29:18 -0800
commit22291cfb1132e89552db38399ab78dd3bfd0c940 (patch)
treed89c4cc246e233d2b69acc75a5b66c1a43fcd2f3 /fs/xfs/scrub
parentc6b4c6212e2a527cbb2cb0097da62a8a0051fc55 (diff)
xfs: create a noalloc mode for allocation groups
Create a new noalloc state for the per-AG structure that will disable block allocation in this AG. We accomplish this by subtracting from fdblocks all the free blocks in this AG, hiding those blocks from the allocator, and preventing freed blocks from updating fdblocks until we're ready to lift noalloc mode. Note that we reduce the free block count of the filesystem so that we can prevent transactions from entering the allocator looking for "free" space that we've turned off incore. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r--fs/xfs/scrub/fscounters.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/scrub/fscounters.c b/fs/xfs/scrub/fscounters.c
index f7e7ae58b4a4..fc0ae3d60657 100644
--- a/fs/xfs/scrub/fscounters.c
+++ b/fs/xfs/scrub/fscounters.c
@@ -239,7 +239,8 @@ retry:
*/
fsc->fdblocks -= pag->pag_meta_resv.ar_reserved;
fsc->fdblocks -= pag->pag_rmapbt_resv.ar_orig_reserved;
-
+ if (pag->pagf_noalloc)
+ fsc->fdblocks -= xfs_ag_fdblocks(pag);
}
if (pag)
xfs_perag_put(pag);