Whamcloud - gitweb
b=24055 a patch to detect if quota is turned on properly
[fs/lustre-release.git] / lustre / quota / quota_master.c
index d8d14d7..f675772 100644 (file)
@@ -215,7 +215,7 @@ static struct lustre_dquot *lustre_dqget(struct obd_device *obd,
                 if (rc) {
                         CERROR("can't read dquot from admin quotafile! "
                                "(rc:%d)\n", rc);
-                        lustre_dqput(dquot);
+                        free_dquot(dquot);
                         RETURN(ERR_PTR(rc));
                 } else {
                         cfs_write_lock(&dquot_hash_lock);
@@ -372,6 +372,10 @@ int dqacq_handler(struct obd_device *obd, struct qunit_data *qdata, int opc)
         if (OBD_FAIL_CHECK(OBD_FAIL_OBD_DQACQ))
                 RETURN(-EIO);
 
+        if (!ll_sb_has_quota_active(qctxt->lqc_sb,
+                                    QDATA_IS_GRP(qdata) ? GRPQUOTA : USRQUOTA))
+                RETURN(-EIO);
+
         lqs = quota_search_lqs(LQS_KEY(QDATA_IS_GRP(qdata), qdata->qd_id),
                                qctxt, 0);
         if (lqs == NULL)
@@ -934,6 +938,8 @@ int do_mds_quota_off(struct obd_device *obd, struct obd_quotactl *oqctl)
         EXIT;
 
 out:
+        CDEBUG(D_QUOTA, "%s: quotaoff type:flags:rc %u:%lu:%d\n",
+               obd->obd_name, oqctl->qc_type, qctxt->lqc_flags, rc);
         cfs_up_write(&mds->mds_qonoff_sem);
         pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         return rc ? : (rc1 ? : rc2);