Skip to content

Commit 6868b85

Browse files
author
Darrick J. Wong
committed
xfs: adjust the incore perag block_count when shrinking
If we reduce the number of blocks in an AG, we must update the incore geometry values as well. Fixes: 0800169 ("xfs: Pre-calculate per-AG agbno geometry") Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
1 parent 94f6f05 commit 6868b85

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/xfs/libxfs/xfs_ag.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,12 @@ xfs_ag_shrink_space(
10011001
error = -ENOSPC;
10021002
goto resv_init_out;
10031003
}
1004+
1005+
/* Update perag geometry */
1006+
pag->block_count -= delta;
1007+
__xfs_agino_range(pag->pag_mount, pag->block_count, &pag->agino_min,
1008+
&pag->agino_max);
1009+
10041010
xfs_ialloc_log_agi(*tpp, agibp, XFS_AGI_LENGTH);
10051011
xfs_alloc_log_agf(*tpp, agfbp, XFS_AGF_LENGTH);
10061012
return 0;

0 commit comments

Comments
 (0)