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: 0800169e3e
("xfs: Pre-calculate per-AG agbno geometry")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
94f6f0550c
commit
6868b8505c
|
@ -1001,6 +1001,12 @@ xfs_ag_shrink_space(
|
|||
error = -ENOSPC;
|
||||
goto resv_init_out;
|
||||
}
|
||||
|
||||
/* Update perag geometry */
|
||||
pag->block_count -= delta;
|
||||
__xfs_agino_range(pag->pag_mount, pag->block_count, &pag->agino_min,
|
||||
&pag->agino_max);
|
||||
|
||||
xfs_ialloc_log_agi(*tpp, agibp, XFS_AGI_LENGTH);
|
||||
xfs_alloc_log_agf(*tpp, agfbp, XFS_AGF_LENGTH);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue