xfs: ensure rtx mask/shift are correct after growfs
authorChristoph Hellwig <hch@lst.de>
Fri, 30 Aug 2024 22:37:01 +0000 (15:37 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Sun, 1 Sep 2024 15:58:19 +0000 (08:58 -0700)
commit86a0264ef26e90214a5bd74c72fb6e3455403bcf
tree3bb9aa94948bf5aa33c6f7dd3a7f03f26a57ad5a
parenta18a69bbec083093c3bfebaec13ce0b4c6b2af7e
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 <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/libxfs/xfs_sb.c
fs/xfs/libxfs/xfs_sb.h
fs/xfs/xfs_rtalloc.c