Whamcloud - gitweb
b=24055 a patch to detect if quota is turned on properly
authorLanden <zhiyong.tian@oracle.com>
Fri, 17 Dec 2010 06:46:28 +0000 (14:46 +0800)
committerAndrew Perepechko <andrew.perepechko@oracle.com>
Fri, 17 Dec 2010 11:47:51 +0000 (14:47 +0300)
i=johann
i=panda

lustre/quota/lproc_quota.c
lustre/quota/quota_ctl.c
lustre/quota/quota_master.c
lustre/tests/sanity-quota.sh

index cbef63d..a79062a 100644 (file)
@@ -302,6 +302,11 @@ int generic_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl, int glo
 
         atomic_inc(&obt->obt_quotachecking);
 
+        CDEBUG(D_QUOTA, "%s: quotaon type:master:global:local:flags:rc "
+               "%u:%d:%d:%d:%lu:%d\n",
+               obd->obd_name, oqctl->qc_type, is_master, global, local,
+               obt->obt_qctxt.lqc_flags, rc);
+
         return rc;
 }
 
index d5bef48..84a649d 100644 (file)
@@ -228,8 +228,12 @@ int filter_quota_ctl(struct obd_export *exp, struct obd_quotactl *oqctl)
 
                 if (oqctl->qc_cmd == Q_QUOTAOFF ||
                     oqctl->qc_cmd == Q_FINVALIDATE) {
-                        if (!rc && oqctl->qc_cmd == Q_QUOTAOFF)
+                        if (!rc && oqctl->qc_cmd == Q_QUOTAOFF) {
                                 obt->obt_qctxt.lqc_flags &= ~UGQUOTA2LQC(oqctl->qc_type);
+                                CDEBUG(D_QUOTA, "%s: quotaoff type:flags:rc "
+                                       "%u:%lu:%d\n", obd->obd_name,
+                                       oqctl->qc_type, qctxt->lqc_flags, rc);
+                        }
                         atomic_inc(&obt->obt_quotachecking);
                 }
                 break;
index 5cec4e7..effd13b 100644 (file)
@@ -958,6 +958,8 @@ int mds_quota_off(struct obd_device *obd, struct obd_quotactl *oqctl)
         if (!rc2)
                 obt->obt_qctxt.lqc_flags &= ~UGQUOTA2LQC(oqctl->qc_type);
 
+        CDEBUG(D_QUOTA, "%s: quotaoff type:flags:rc %u:%lu:%d\n",
+               obd->obd_name, oqctl->qc_type, obt->obt_qctxt.lqc_flags, rc);
         pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         up(&mds->mds_qonoff_sem);
         atomic_inc(&obt->obt_quotachecking);
index 6309ad5..03b2e74 100755 (executable)
@@ -292,17 +292,17 @@ quota_show_check() {
 
 # set quota
 test_0() {
-        $LFS quotaoff -ug $DIR
-        $LFS quotacheck -ug $DIR
-
-         resetquota -u $TSTUSR
-         resetquota -g $TSTUSR
-
         lctl set_param debug="+quota"
         do_facet mds "lctl set_param debug=+quota"
         for num in `seq $OSTCOUNT`; do
-            do_facet ost$num "lctl set_param debug=+quota"
+           do_facet ost$num "lctl set_param debug=+quota"
         done
+
+        log "do the quotacheck ..."
+        $LFS quotacheck -ug $DIR
+
+        resetquota -u $TSTUSR
+        resetquota -g $TSTUSR
 }
 run_test_with_stat 0 "Set quota ============================="