Whamcloud - gitweb
b=18083
authoranserper <anserper>
Wed, 24 Dec 2008 17:03:46 +0000 (17:03 +0000)
committeranserper <anserper>
Wed, 24 Dec 2008 17:03:46 +0000 (17:03 +0000)
i=Yong Fan
i=Andrew Perepechko

Force current op. quota files format for MDS op. quota files

lustre/quota/quota_ctl.c
lustre/quota/quota_master.c

index ebdb535..b7e4aee 100644 (file)
@@ -67,6 +67,7 @@
 int mds_quota_ctl(struct obd_export *exp, struct obd_quotactl *oqctl)
 {
         struct obd_device *obd = exp->exp_obd;
+        struct obd_device_target *obt = &obd->u.obt;
         struct lustre_quota_ctxt *qctxt = &obd->u.obt.obt_qctxt;
         struct timeval work_start;
         struct timeval work_end;
@@ -77,9 +78,11 @@ int mds_quota_ctl(struct obd_export *exp, struct obd_quotactl *oqctl)
         do_gettimeofday(&work_start);
         switch (oqctl->qc_cmd) {
         case Q_QUOTAON:
+                oqctl->qc_id = obt->obt_qfmt; /* override qfmt version */
                 rc = mds_quota_on(obd, oqctl);
                 break;
         case Q_QUOTAOFF:
+                oqctl->qc_id = obt->obt_qfmt; /* override qfmt version */
                 mds_quota_off(obd, oqctl);
                 break;
         case Q_SETINFO:
@@ -102,6 +105,7 @@ int mds_quota_ctl(struct obd_export *exp, struct obd_quotactl *oqctl)
                 rc = mds_quota_invalidate(obd, oqctl);
                 break;
         case LUSTRE_Q_FINVALIDATE:
+                oqctl->qc_id = obt->obt_qfmt; /* override qfmt version */
                 rc = mds_quota_finvalidate(obd, oqctl);
                 break;
         default:
index ea71dcb..adcdd3c 100644 (file)
@@ -662,7 +662,6 @@ int mds_quota_finvalidate(struct obd_device *obd, struct obd_quotactl *oqctl)
         down(&mds->mds_qonoff_sem);
 
         oqctl->qc_cmd = Q_FINVALIDATE;
-        oqctl->qc_id = obd->u.obt.obt_qfmt;
         rc = fsfilt_quotactl(obd, obd->u.obt.obt_sb, oqctl);
         if (!rc)
                 rc = obd_quotactl(mds->mds_osc_exp, oqctl);
@@ -900,15 +899,16 @@ int mds_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl)
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         rc = mds_admin_quota_on(obd, oqctl);
         if (rc)
-                goto out;
-
-        rc = obd_quotactl(mds->mds_osc_exp, oqctl);
-        if (rc)
-                goto out;
+                GOTO(out, rc);
 
         rc = fsfilt_quotactl(obd, obd->u.obt.obt_sb, oqctl);
         if (!rc)
                 obt->obt_qctxt.lqc_flags |= UGQUOTA2LQC(oqctl->qc_type);
+        else
+                GOTO(out, rc);
+
+        rc = obd_quotactl(mds->mds_osc_exp, oqctl);
+
 out:
         pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         up(&mds->mds_qonoff_sem);