hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
kernel/fs/xfs/xfs_qm.c
....@@ -1318,8 +1318,15 @@
13181318
13191319 error = xfs_iwalk_threaded(mp, 0, 0, xfs_qm_dqusage_adjust, 0, true,
13201320 NULL);
1321
- if (error)
1321
+ if (error) {
1322
+ /*
1323
+ * The inode walk may have partially populated the dquot
1324
+ * caches. We must purge them before disabling quota and
1325
+ * tearing down the quotainfo, or else the dquots will leak.
1326
+ */
1327
+ xfs_qm_dqpurge_all(mp, XFS_QMOPT_QUOTALL);
13221328 goto error_return;
1329
+ }
13231330
13241331 /*
13251332 * We've made all the changes that we need to make incore. Flush them