Skip to content

Commit cd8d049

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
xfs: add a xfs_qm_unmount_rt helper
RT group enabled file systems fix the bug where we pointlessly attach quotas to the RT bitmap and summary files. Split the code to detach the quotas into a helper, make it conditional and document the differing behavior for RT group and pre-RT group file systems. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 9c3cfb9 commit cd8d049

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

fs/xfs/xfs_qm.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "xfs_health.h"
3030
#include "xfs_da_format.h"
3131
#include "xfs_metafile.h"
32+
#include "xfs_rtgroup.h"
3233

3334
/*
3435
* The global quota manager. There is only one of these for the entire
@@ -210,6 +211,16 @@ xfs_qm_unmount(
210211
}
211212
}
212213

214+
static void
215+
xfs_qm_unmount_rt(
216+
struct xfs_mount *mp)
217+
{
218+
if (mp->m_rbmip)
219+
xfs_qm_dqdetach(mp->m_rbmip);
220+
if (mp->m_rsumip)
221+
xfs_qm_dqdetach(mp->m_rsumip);
222+
}
223+
213224
/*
214225
* Called from the vfsops layer.
215226
*/
@@ -223,10 +234,13 @@ xfs_qm_unmount_quotas(
223234
*/
224235
ASSERT(mp->m_rootip);
225236
xfs_qm_dqdetach(mp->m_rootip);
226-
if (mp->m_rbmip)
227-
xfs_qm_dqdetach(mp->m_rbmip);
228-
if (mp->m_rsumip)
229-
xfs_qm_dqdetach(mp->m_rsumip);
237+
238+
/*
239+
* For pre-RTG file systems, the RT inodes have quotas attached,
240+
* detach them now.
241+
*/
242+
if (!xfs_has_rtgroups(mp))
243+
xfs_qm_unmount_rt(mp);
230244

231245
/*
232246
* Release the quota inodes.

0 commit comments

Comments
 (0)