]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: recompute growfsrtfree transaction reservation while growing rt volume
authorDarrick J. Wong <djwong@kernel.org>
Wed, 27 Mar 2024 00:12:22 +0000 (17:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:28:47 +0000 (15:28 +0200)
commit84cd4f79b4cece8d00c2c8826cdddbfd6bc5e31d
treec94f95d5f3c499d61d2fb9d796fd7ea92b7e4b7f
parentd6b65ed1cc5f73de6d59af56c3d5fbea9df97bec
xfs: recompute growfsrtfree transaction reservation while growing rt volume

commit 578bd4ce7100ae34f98c6b0147fe75cfa0dadbac upstream.

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: Catherine Hoang <catherine.hoang@oracle.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_rtalloc.c