diff options
Diffstat (limited to 'fs/xfs/xfs_qm_syscalls.c')
-rw-r--r-- | fs/xfs/xfs_qm_syscalls.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index a08801ae24e2..e4f8b2d6f38b 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c | |||
@@ -119,7 +119,8 @@ xfs_qm_scall_quotaoff( | |||
119 | dqtype |= XFS_QMOPT_GQUOTA; | 119 | dqtype |= XFS_QMOPT_GQUOTA; |
120 | flags |= (XFS_GQUOTA_CHKD | XFS_GQUOTA_ENFD); | 120 | flags |= (XFS_GQUOTA_CHKD | XFS_GQUOTA_ENFD); |
121 | inactivate_flags |= XFS_GQUOTA_ACTIVE; | 121 | inactivate_flags |= XFS_GQUOTA_ACTIVE; |
122 | } else if (flags & XFS_PQUOTA_ACCT) { | 122 | } |
123 | if (flags & XFS_PQUOTA_ACCT) { | ||
123 | dqtype |= XFS_QMOPT_PQUOTA; | 124 | dqtype |= XFS_QMOPT_PQUOTA; |
124 | flags |= (XFS_PQUOTA_CHKD | XFS_PQUOTA_ENFD); | 125 | flags |= (XFS_PQUOTA_CHKD | XFS_PQUOTA_ENFD); |
125 | inactivate_flags |= XFS_PQUOTA_ACTIVE; | 126 | inactivate_flags |= XFS_PQUOTA_ACTIVE; |
@@ -198,10 +199,9 @@ xfs_qm_scall_quotaoff( | |||
198 | } | 199 | } |
199 | 200 | ||
200 | /* | 201 | /* |
201 | * If quotas is completely disabled, close shop. | 202 | * If all quotas are completely turned off, close shop. |
202 | */ | 203 | */ |
203 | if (((flags & XFS_MOUNT_QUOTA_ALL) == XFS_MOUNT_QUOTA_SET1) || | 204 | if (mp->m_qflags == 0) { |
204 | ((flags & XFS_MOUNT_QUOTA_ALL) == XFS_MOUNT_QUOTA_SET2)) { | ||
205 | mutex_unlock(&q->qi_quotaofflock); | 205 | mutex_unlock(&q->qi_quotaofflock); |
206 | xfs_qm_destroy_quotainfo(mp); | 206 | xfs_qm_destroy_quotainfo(mp); |
207 | return (0); | 207 | return (0); |
@@ -214,10 +214,14 @@ xfs_qm_scall_quotaoff( | |||
214 | IRELE(q->qi_uquotaip); | 214 | IRELE(q->qi_uquotaip); |
215 | q->qi_uquotaip = NULL; | 215 | q->qi_uquotaip = NULL; |
216 | } | 216 | } |
217 | if ((dqtype & (XFS_QMOPT_GQUOTA|XFS_QMOPT_PQUOTA)) && q->qi_gquotaip) { | 217 | if ((dqtype & XFS_QMOPT_GQUOTA) && q->qi_gquotaip) { |
218 | IRELE(q->qi_gquotaip); | 218 | IRELE(q->qi_gquotaip); |
219 | q->qi_gquotaip = NULL; | 219 | q->qi_gquotaip = NULL; |
220 | } | 220 | } |
221 | if ((dqtype & XFS_QMOPT_PQUOTA) && q->qi_pquotaip) { | ||
222 | IRELE(q->qi_pquotaip); | ||
223 | q->qi_pquotaip = NULL; | ||
224 | } | ||
221 | 225 | ||
222 | out_unlock: | 226 | out_unlock: |
223 | mutex_unlock(&q->qi_quotaofflock); | 227 | mutex_unlock(&q->qi_quotaofflock); |
@@ -859,9 +863,11 @@ xfs_dqrele_inode( | |||
859 | { | 863 | { |
860 | /* skip quota inodes */ | 864 | /* skip quota inodes */ |
861 | if (ip == ip->i_mount->m_quotainfo->qi_uquotaip || | 865 | if (ip == ip->i_mount->m_quotainfo->qi_uquotaip || |
862 | ip == ip->i_mount->m_quotainfo->qi_gquotaip) { | 866 | ip == ip->i_mount->m_quotainfo->qi_gquotaip || |
867 | ip == ip->i_mount->m_quotainfo->qi_pquotaip) { | ||
863 | ASSERT(ip->i_udquot == NULL); | 868 | ASSERT(ip->i_udquot == NULL); |
864 | ASSERT(ip->i_gdquot == NULL); | 869 | ASSERT(ip->i_gdquot == NULL); |
870 | ASSERT(ip->i_pdquot == NULL); | ||
865 | return 0; | 871 | return 0; |
866 | } | 872 | } |
867 | 873 | ||
@@ -870,10 +876,14 @@ xfs_dqrele_inode( | |||
870 | xfs_qm_dqrele(ip->i_udquot); | 876 | xfs_qm_dqrele(ip->i_udquot); |
871 | ip->i_udquot = NULL; | 877 | ip->i_udquot = NULL; |
872 | } | 878 | } |
873 | if (flags & (XFS_PQUOTA_ACCT|XFS_GQUOTA_ACCT) && ip->i_gdquot) { | 879 | if ((flags & XFS_GQUOTA_ACCT) && ip->i_gdquot) { |
874 | xfs_qm_dqrele(ip->i_gdquot); | 880 | xfs_qm_dqrele(ip->i_gdquot); |
875 | ip->i_gdquot = NULL; | 881 | ip->i_gdquot = NULL; |
876 | } | 882 | } |
883 | if ((flags & XFS_PQUOTA_ACCT) && ip->i_pdquot) { | ||
884 | xfs_qm_dqrele(ip->i_pdquot); | ||
885 | ip->i_pdquot = NULL; | ||
886 | } | ||
877 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | 887 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
878 | return 0; | 888 | return 0; |
879 | } | 889 | } |