mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
xfs: recompute growfsrtfree transaction reservation while growing rt volume
[ Upstream commit 578bd4ce7100ae34f98c6b0147fe75cfa0dadbac ] While playing with growfs to create a 20TB realtime section on a filesystem that didn't previously have an rt section, I noticed that growfs would occasionally shut down the log due to a transaction reservation overflow. xfs_calc_growrtfree_reservation uses the current size of the realtime summary file (m_rsumsize) to compute the transaction reservation for a growrtfree transaction. The reservations are computed at mount time, which means that m_rsumsize is zero when growfs starts "freeing" the new realtime extents into the rt volume. As a result, the transaction is undersized and fails. Fix this by recomputing the transaction reservations every time we change m_rsumsize. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com> Acked-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
072a9c45d2
commit
ec1d3a6899
@@ -1070,6 +1070,9 @@ xfs_growfs_rt(
|
|||||||
nsbp->sb_rbmblocks;
|
nsbp->sb_rbmblocks;
|
||||||
nrsumblocks = XFS_B_TO_FSB(mp, nrsumsize);
|
nrsumblocks = XFS_B_TO_FSB(mp, nrsumsize);
|
||||||
nmp->m_rsumsize = nrsumsize = XFS_FSB_TO_B(mp, nrsumblocks);
|
nmp->m_rsumsize = nrsumsize = XFS_FSB_TO_B(mp, nrsumblocks);
|
||||||
|
/* recompute growfsrt reservation from new rsumsize */
|
||||||
|
xfs_trans_resv_calc(nmp, &nmp->m_resv);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start a transaction, get the log reservation.
|
* Start a transaction, get the log reservation.
|
||||||
*/
|
*/
|
||||||
@@ -1153,6 +1156,8 @@ error_cancel:
|
|||||||
*/
|
*/
|
||||||
mp->m_rsumlevels = nrsumlevels;
|
mp->m_rsumlevels = nrsumlevels;
|
||||||
mp->m_rsumsize = nrsumsize;
|
mp->m_rsumsize = nrsumsize;
|
||||||
|
/* recompute growfsrt reservation from new rsumsize */
|
||||||
|
xfs_trans_resv_calc(mp, &mp->m_resv);
|
||||||
|
|
||||||
error = xfs_trans_commit(tp);
|
error = xfs_trans_commit(tp);
|
||||||
if (error)
|
if (error)
|
||||||
|
|||||||
Reference in New Issue
Block a user