Whamcloud - gitweb
b=23634 sanity-sec RUNAS fix
[fs/lustre-release.git] / lustre / quota / quota_check.c
index 17f20d8..c6e8daa 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -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);
 }