Whamcloud - gitweb
b=21147 fix unnecessary semaphore release in generic_quota_on
authorAndrew Perepechko <Andrew.Perepechko@Sun.COM>
Thu, 21 Jan 2010 12:08:28 +0000 (15:08 +0300)
committerJohann Lombardi <johann@sun.com>
Fri, 22 Jan 2010 09:09:26 +0000 (10:09 +0100)
i=Johann Lombardi

lustre/quota/lproc_quota.c

index 475debf..425b4f5 100644 (file)
@@ -259,16 +259,19 @@ int generic_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl, int glo
         oqctl->qc_cmd = Q_QUOTAON;
         oqctl->qc_id = obt->obt_qfmt;
 
-        is_master= !strcmp(obd->obd_type->typ_name, LUSTRE_MDS_NAME);
-        if (is_master && local) {
+        is_master = !strcmp(obd->obd_type->typ_name, LUSTRE_MDS_NAME);
+        if (is_master) {
                 down(&obd->u.mds.mds_qonoff_sem);
-                push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
-                /* turn on cluster wide quota */
-                rc = mds_admin_quota_on(obd, oqctl);
-                pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
-                if (rc && rc != -ENOENT)
-                        CERROR("%s: %s admin quotaon failed. rc=%d\n",
-                               obd->obd_name, global ? "global" : "local", rc);
+                if (local) {
+                        push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+                        /* turn on cluster wide quota */
+                        rc = mds_admin_quota_on(obd, oqctl);
+                        pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+                        if (rc && rc != -ENOENT)
+                                CERROR("%s: %s admin quotaon failed. rc=%d\n",
+                                       obd->obd_name, global? "global":"local",
+                                       rc);
+                }
         }
 
         if (rc == 0) {