aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKouta Ooizumi <k-ooizumi@tnes.nec.co.jp>2007-05-07 23:49:33 -0400
committerTim Shimmin <tes@sgi.com>2007-05-07 23:49:33 -0400
commite6d29426bc8a5d07d0eebd0842fe0cf6ecc862cd (patch)
treef1b8e35adbd87230913d8a40ddb1b228f18ce323 /fs
parentd3cf209476b72c83907a412b6708c5e498410aa7 (diff)
[XFS] Fix uquota and oquota enforcement problems.
When uquota and oquota (gquota/pquota) are enabled for accounting both are enforced if ether has enforcement active. Conditions: - Both XFS_UQUOTA_ACCT and XFS_GQUOTA_ACCT are enabled. - Either XFS_UQUOTA_ENFD or XFS_OQUOTA_ENFD is enabled. - The usage without enforce is reached at the soft limit. Problems: 1. "repquota" shows all grace time even if no enforcement. 2. we cannot make a file over a hard limits even if no enforcement. SGI-PV: 962291 SGI-Modid: xfs-linux-melb:xfs-kern:28272a Signed-off-by: Kouta Ooizumi <k-ooizumi@tnes.nec.co.jp> Signed-off-by: Donald Douwsma <donaldd@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/quota/xfs_qm_syscalls.c9
-rw-r--r--fs/xfs/quota/xfs_trans_dquot.c4
-rw-r--r--fs/xfs/xfs_quota.h3
3 files changed, 12 insertions, 4 deletions
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c
index 22d853e77cda..2df67fd913e5 100644
--- a/fs/xfs/quota/xfs_qm_syscalls.c
+++ b/fs/xfs/quota/xfs_qm_syscalls.c
@@ -909,14 +909,19 @@ xfs_qm_export_dquot(
909 * gets turned off. No need to confuse the user level code, 909 * gets turned off. No need to confuse the user level code,
910 * so return zeroes in that case. 910 * so return zeroes in that case.
911 */ 911 */
912 if (! XFS_IS_QUOTA_ENFORCED(mp)) { 912 if ((!XFS_IS_UQUOTA_ENFORCED(mp) && src->d_flags == XFS_DQ_USER) ||
913 (!XFS_IS_OQUOTA_ENFORCED(mp) &&
914 (src->d_flags & (XFS_DQ_PROJ | XFS_DQ_GROUP)))) {
913 dst->d_btimer = 0; 915 dst->d_btimer = 0;
914 dst->d_itimer = 0; 916 dst->d_itimer = 0;
915 dst->d_rtbtimer = 0; 917 dst->d_rtbtimer = 0;
916 } 918 }
917 919
918#ifdef DEBUG 920#ifdef DEBUG
919 if (XFS_IS_QUOTA_ENFORCED(mp) && dst->d_id != 0) { 921 if (((XFS_IS_UQUOTA_ENFORCED(mp) && dst->d_flags == XFS_USER_QUOTA) ||
922 (XFS_IS_OQUOTA_ENFORCED(mp) &&
923 (dst->d_flags & (XFS_PROJ_QUOTA | XFS_GROUP_QUOTA)))) &&
924 dst->d_id != 0) {
920 if (((int) dst->d_bcount >= (int) dst->d_blk_softlimit) && 925 if (((int) dst->d_bcount >= (int) dst->d_blk_softlimit) &&
921 (dst->d_blk_softlimit > 0)) { 926 (dst->d_blk_softlimit > 0)) {
922 ASSERT(dst->d_btimer != 0); 927 ASSERT(dst->d_btimer != 0);
diff --git a/fs/xfs/quota/xfs_trans_dquot.c b/fs/xfs/quota/xfs_trans_dquot.c
index d7491e7b1f3b..7de6874bf1b8 100644
--- a/fs/xfs/quota/xfs_trans_dquot.c
+++ b/fs/xfs/quota/xfs_trans_dquot.c
@@ -656,7 +656,9 @@ xfs_trans_dqresv(
656 656
657 if ((flags & XFS_QMOPT_FORCE_RES) == 0 && 657 if ((flags & XFS_QMOPT_FORCE_RES) == 0 &&
658 dqp->q_core.d_id && 658 dqp->q_core.d_id &&
659 XFS_IS_QUOTA_ENFORCED(dqp->q_mount)) { 659 ((XFS_IS_UQUOTA_ENFORCED(dqp->q_mount) && XFS_QM_ISUDQ(dqp)) ||
660 (XFS_IS_OQUOTA_ENFORCED(dqp->q_mount) &&
661 (XFS_QM_ISPDQ(dqp) || XFS_QM_ISGDQ(dqp))))) {
660#ifdef QUOTADEBUG 662#ifdef QUOTADEBUG
661 cmn_err(CE_DEBUG, "BLK Res: nblks=%ld + resbcount=%Ld" 663 cmn_err(CE_DEBUG, "BLK Res: nblks=%ld + resbcount=%Ld"
662 " > hardlimit=%Ld?", nblks, *resbcountp, hardlimit); 664 " > hardlimit=%Ld?", nblks, *resbcountp, hardlimit);
diff --git a/fs/xfs/xfs_quota.h b/fs/xfs/xfs_quota.h
index 9dcb32aa4e2e..6f14df976f73 100644
--- a/fs/xfs/xfs_quota.h
+++ b/fs/xfs/xfs_quota.h
@@ -154,10 +154,11 @@ typedef struct xfs_qoff_logformat {
154#define XFS_ALL_QUOTA_CHKD (XFS_UQUOTA_CHKD | XFS_OQUOTA_CHKD) 154#define XFS_ALL_QUOTA_CHKD (XFS_UQUOTA_CHKD | XFS_OQUOTA_CHKD)
155 155
156#define XFS_IS_QUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT) 156#define XFS_IS_QUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT)
157#define XFS_IS_QUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ENFD)
158#define XFS_IS_UQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_UQUOTA_ACCT) 157#define XFS_IS_UQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_UQUOTA_ACCT)
159#define XFS_IS_PQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_PQUOTA_ACCT) 158#define XFS_IS_PQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_PQUOTA_ACCT)
160#define XFS_IS_GQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_GQUOTA_ACCT) 159#define XFS_IS_GQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_GQUOTA_ACCT)
160#define XFS_IS_UQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_UQUOTA_ENFD)
161#define XFS_IS_OQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_OQUOTA_ENFD)
161 162
162/* 163/*
163 * Incore only flags for quotaoff - these bits get cleared when quota(s) 164 * Incore only flags for quotaoff - these bits get cleared when quota(s)