]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: enable realtime quota again
authorDarrick J. Wong <djwong@kernel.org>
Mon, 23 Sep 2024 20:20:39 +0000 (13:20 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 9 Oct 2024 13:55:44 +0000 (15:55 +0200)
Enable quotas for the realtime device.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/xfs_qm.c
fs/xfs/xfs_rtalloc.c

index 90d45aae5cb8910c01a0b4b4e8e6341e8748564f..e18784804fcb03126db7569357aa7cfc972a2e5a 100644 (file)
@@ -1663,14 +1663,18 @@ xfs_qm_mount_quotas(
        uint                    sbf;
 
        /*
-        * If quotas on realtime volumes is not supported, we disable
-        * quotas immediately.
+        * If quotas on realtime volumes is not supported, disable quotas
+        * immediately.  We only support rtquota if rtgroups are enabled to
+        * avoid problems with older kernels.
         */
-       if (mp->m_sb.sb_rextents) {
+       if (mp->m_sb.sb_rextents && !xfs_has_rtgroups(mp)) {
                xfs_notice(mp, "Cannot turn on quotas for realtime filesystem");
                mp->m_qflags = 0;
                goto write_changes;
        }
+       if (mp->m_sb.sb_rextents)
+               xfs_warn(mp,
+ "EXPERIMENTAL realtime quota feature in use. Use at your own risk!");
 
        ASSERT(XFS_IS_QUOTA_ON(mp));
 
index 452037d1833bb3005c081e5d4ed4b347864bd1f7..02e45e73ce240dcf5c264af769256d0b4591c7b5 100644 (file)
@@ -1263,7 +1263,9 @@ xfs_growfs_rt(
 
        /* Unsupported realtime features. */
        error = -EOPNOTSUPP;
-       if (xfs_has_rmapbt(mp) || xfs_has_reflink(mp) || xfs_has_quota(mp))
+       if (xfs_has_quota(mp) && !xfs_has_rtgroups(mp))
+               goto out_unlock;
+       if (xfs_has_rmapbt(mp) || xfs_has_reflink(mp))
                goto out_unlock;
 
        error = xfs_sb_validate_fsb_count(&mp->m_sb, in->newblocks);