diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-11-14 13:27:44 +0100 |
---|---|---|
committer | Carlos Maiolino <cem@kernel.org> | 2023-11-14 13:32:52 +0100 |
commit | 58a554169d59f007b9fb8a388bad2c3209b1fb44 (patch) | |
tree | edff58bed23e295a821d1ca779a9f3909997ff8c | |
parent | 751df4375bfabdeec29310d34d0b5a78938ccd13 (diff) | |
download | xfsprogs-dev-libxfs-sync-6.6.tar.gz |
xfs: adjust the incore perag block_count when shrinkinglibxfs-sync-6.6
Source kernel commit: 6868b8505c807ad9397d78cc4e07cb1cb3582152
If we reduce the number of blocks in an AG, we must update the incore
geometry values as well.
Fixes: 0800169e3e2c9 ("xfs: Pre-calculate per-AG agbno geometry")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
-rw-r--r-- | libxfs/xfs_ag.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libxfs/xfs_ag.c b/libxfs/xfs_ag.c index 75711cbaef..ac34a1c233 100644 --- a/libxfs/xfs_ag.c +++ b/libxfs/xfs_ag.c @@ -999,6 +999,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; |