aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_qm_syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_qm_syscalls.c')
-rw-r--r--fs/xfs/xfs_qm_syscalls.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index a08801ae24e2..b9363838b42b 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;
@@ -214,10 +215,14 @@ xfs_qm_scall_quotaoff(
214 IRELE(q->qi_uquotaip); 215 IRELE(q->qi_uquotaip);
215 q->qi_uquotaip = NULL; 216 q->qi_uquotaip = NULL;
216 } 217 }
217 if ((dqtype & (XFS_QMOPT_GQUOTA|XFS_QMOPT_PQUOTA)) && q->qi_gquotaip) { 218 if ((dqtype & XFS_QMOPT_GQUOTA) && q->qi_gquotaip) {
218 IRELE(q->qi_gquotaip); 219 IRELE(q->qi_gquotaip);
219 q->qi_gquotaip = NULL; 220 q->qi_gquotaip = NULL;
220 } 221 }
222 if ((dqtype & XFS_QMOPT_PQUOTA) && q->qi_pquotaip) {
223 IRELE(q->qi_pquotaip);
224 q->qi_pquotaip = NULL;
225 }
221 226
222out_unlock: 227out_unlock:
223 mutex_unlock(&q->qi_quotaofflock); 228 mutex_unlock(&q->qi_quotaofflock);
@@ -859,9 +864,11 @@ xfs_dqrele_inode(
859{ 864{
860 /* skip quota inodes */ 865 /* skip quota inodes */
861 if (ip == ip->i_mount->m_quotainfo->qi_uquotaip || 866 if (ip == ip->i_mount->m_quotainfo->qi_uquotaip ||
862 ip == ip->i_mount->m_quotainfo->qi_gquotaip) { 867 ip == ip->i_mount->m_quotainfo->qi_gquotaip ||
868 ip == ip->i_mount->m_quotainfo->qi_pquotaip) {
863 ASSERT(ip->i_udquot == NULL); 869 ASSERT(ip->i_udquot == NULL);
864 ASSERT(ip->i_gdquot == NULL); 870 ASSERT(ip->i_gdquot == NULL);
871 ASSERT(ip->i_pdquot == NULL);
865 return 0; 872 return 0;
866 } 873 }
867 874
@@ -870,10 +877,14 @@ xfs_dqrele_inode(
870 xfs_qm_dqrele(ip->i_udquot); 877 xfs_qm_dqrele(ip->i_udquot);
871 ip->i_udquot = NULL; 878 ip->i_udquot = NULL;
872 } 879 }
873 if (flags & (XFS_PQUOTA_ACCT|XFS_GQUOTA_ACCT) && ip->i_gdquot) { 880 if ((flags & XFS_GQUOTA_ACCT) && ip->i_gdquot) {
874 xfs_qm_dqrele(ip->i_gdquot); 881 xfs_qm_dqrele(ip->i_gdquot);
875 ip->i_gdquot = NULL; 882 ip->i_gdquot = NULL;
876 } 883 }
884 if ((flags & XFS_PQUOTA_ACCT) && ip->i_pdquot) {
885 xfs_qm_dqrele(ip->i_pdquot);
886 ip->i_pdquot = NULL;
887 }
877 xfs_iunlock(ip, XFS_ILOCK_EXCL); 888 xfs_iunlock(ip, XFS_ILOCK_EXCL);
878 return 0; 889 return 0;
879} 890}