Whamcloud - gitweb
b=23196 obd reference fixes in lov_quota_check
authorAndrew Perepechko <Andrew.Perepechko@Sun.COM>
Sun, 27 Jun 2010 18:27:17 +0000 (22:27 +0400)
committerjohann <johann@granier.local>
Sun, 27 Jun 2010 21:00:19 +0000 (23:00 +0200)
i=Johann Lombardi

lustre/quota/quota_check.c

index 4368db4..a689d00 100644 (file)
@@ -246,10 +246,13 @@ int lov_quota_check(struct obd_export *exp, struct obd_quotactl *oqctl)
         int i, rc = 0;
         ENTRY;
 
+        obd_getref(obd);
+
         for (i = 0; i < lov->desc.ld_tgt_count; i++) {
                 if (!lov->lov_tgts[i] || !lov->lov_tgts[i]->ltd_active) {
                         CERROR("lov idx %d inactive\n", i);
-                        RETURN(-EIO);
+                        rc = -EIO;
+                        goto out;
                 }
         }
 
@@ -261,5 +264,8 @@ int lov_quota_check(struct obd_export *exp, struct obd_quotactl *oqctl)
                         rc = err;
         }
 
+out:
+        obd_putref(obd);
+
         RETURN(rc);
 }