]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xfs: Fix the logic check for all quotas being turned off
authorChandra Seetharaman <sekharan@us.ibm.com>
Wed, 10 Jul 2013 23:00:36 +0000 (18:00 -0500)
committerBen Myers <bpm@sgi.com>
Thu, 11 Jul 2013 21:49:10 +0000 (16:49 -0500)
During the review of seperate pquota inode patches, David noticed
that the test to detect all quotas being turned off was
incorrect, and hence the block was not freeing all the quota
information.

The check made sense in Irix, but in Linux, quota is turned off
one at a time, which makes the test invalid for Linux.

This problem existed since XFS was ported to Linux.

David suggested to fix the problem by detecting when all quotas are
turned off by checking m_qflags.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_qm_syscalls.c
fs/xfs/xfs_quota.h

index b9363838b42ba67582abb35a4937ae1c143bc9d2..e4f8b2d6f38ba1960beefe35cbd15b0066f530cf 100644 (file)
@@ -199,10 +199,9 @@ xfs_qm_scall_quotaoff(
        }
 
        /*
-        * If quotas is completely disabled, close shop.
+        * If all quotas are completely turned off, close shop.
         */
-       if (((flags & XFS_MOUNT_QUOTA_ALL) == XFS_MOUNT_QUOTA_SET1) ||
-           ((flags & XFS_MOUNT_QUOTA_ALL) == XFS_MOUNT_QUOTA_SET2)) {
+       if (mp->m_qflags == 0) {
                mutex_unlock(&q->qi_quotaofflock);
                xfs_qm_destroy_quotainfo(mp);
                return (0);
index 09777c41d5b7cd8e7a5067c460fcc95d09e630bc..b14f42c714b609b95eab2b993805a7e4e4e73c24 100644 (file)
@@ -301,14 +301,6 @@ typedef struct xfs_qoff_logformat {
         (XFS_IS_PQUOTA_ON(mp) && \
                (mp->m_sb.sb_qflags & XFS_PQUOTA_CHKD) == 0))
 
-#define XFS_MOUNT_QUOTA_SET1   (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\
-                                XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|\
-                                XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD)
-
-#define XFS_MOUNT_QUOTA_SET2   (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\
-                                XFS_UQUOTA_CHKD|XFS_PQUOTA_ACCT|\
-                                XFS_PQUOTA_ENFD|XFS_PQUOTA_CHKD)
-
 #define XFS_MOUNT_QUOTA_ALL    (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\
                                 XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|\
                                 XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD|\