diff options
| author | Christoph Hellwig <[email protected]> | 2024-08-30 22:37:01 +0000 |
|---|---|---|
| committer | Darrick J. Wong <[email protected]> | 2024-09-01 15:58:19 +0000 |
| commit | 86a0264ef26e90214a5bd74c72fb6e3455403bcf (patch) | |
| tree | 3bb9aa94948bf5aa33c6f7dd3a7f03f26a57ad5a /fs/xfs/xfs_rtalloc.c | |
| parent | xfs: use the recalculated transaction reservation in xfs_growfs_rt_bmblock (diff) | |
| download | kernel-86a0264ef26e90214a5bd74c72fb6e3455403bcf.tar.gz kernel-86a0264ef26e90214a5bd74c72fb6e3455403bcf.zip | |
xfs: ensure rtx mask/shift are correct after growfs
When growfs sets an extent size, it doesn't updated the m_rtxblklog and
m_rtxblkmask values, which could lead to incorrect usage of them if they
were set before and can't be used for the new extent size.
Add a xfs_mount_sb_set_rextsize helper that updates the two fields, and
also use it when calculating the new RT geometry instead of disabling
the optimization there.
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
| -rw-r--r-- | fs/xfs/xfs_rtalloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index a9f08d96f1fe..4bbb50d5a4b7 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -719,8 +719,8 @@ xfs_growfs_rt_bmblock( /* * Calculate new sb and mount fields for this round. */ - nmp->m_rtxblklog = -1; /* don't use shift or masking */ nmp->m_sb.sb_rextsize = rextsize; + xfs_mount_sb_set_rextsize(nmp, &nmp->m_sb); nmp->m_sb.sb_rbmblocks = bmbno + 1; nmp->m_sb.sb_rblocks = min(nrblocks, nrblocks_step); nmp->m_sb.sb_rextents = xfs_rtb_to_rtx(nmp, nmp->m_sb.sb_rblocks); @@ -807,10 +807,11 @@ xfs_growfs_rt_bmblock( xfs_trans_mod_sb(args.tp, XFS_TRANS_SB_FREXTENTS, freed_rtx); /* - * Update mp values into the real mp structure. + * Update the calculated values in the real mount structure. */ mp->m_rsumlevels = nmp->m_rsumlevels; mp->m_rsumsize = nmp->m_rsumsize; + xfs_mount_sb_set_rextsize(mp, &mp->m_sb); /* * Recompute the growfsrt reservation from the new rsumsize. |
