- id = UGQUOTA2LQC(type);
- /* quota already turned on */
- if ((obt->obt_qctxt.lqc_flags & id) == id) {
- rc = 0;
- goto out;
- }
- if (obt->obt_qctxt.lqc_immutable) {
- LCONSOLE_ERROR("Failed to turn Quota on, immutable mode "
- "(is SOM enabled?)\n");
- goto out;
+ if (rc == 0) {
+ if (local) {
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+ rc = fsfilt_quotactl(obd, obt->obt_sb, oqctl);
+ if (rc) {
+ if (rc != -ENOENT)
+ CERROR("%s: %s quotaon failed with"
+ " rc=%d\n", obd->obd_name,
+ global ? "global" : "local", rc);
+ } else {
+ obt->obt_qctxt.lqc_flags |= UGQUOTA2LQC(oqctl->qc_type);
+ build_lqs(obd);
+ }
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+ }
+
+ if (rc == 0 && global && is_master)
+ rc = obd_quotactl(obd->u.mds.mds_osc_exp, oqctl);