Whamcloud - gitweb
b=23196 take lov reference in lov_quota_check
authorAndrew Perepechko <Andrew.Perepechko@sun.com>
Mon, 16 Aug 2010 11:58:06 +0000 (15:58 +0400)
committerMikhail Pershin <tappro@sun.com>
Mon, 16 Aug 2010 20:18:41 +0000 (00:18 +0400)
i=Johann Lombardi
i=ZhiYong Tian

lustre/quota/quota_check.c

index 1961e40..c6e8daa 100644 (file)
@@ -298,10 +298,13 @@ int lov_quota_check(struct obd_device *unused, struct obd_export *exp,
         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;
                 }
         }
 
@@ -313,5 +316,8 @@ int lov_quota_check(struct obd_device *unused, struct obd_export *exp,
                         rc = err;
         }
 
+out:
+        obd_putref(obd);
+
         RETURN(rc);
 }