Whamcloud - gitweb
- extN-wantedi accepts generation as well as ino to create an inode with
[fs/lustre-release.git] / lustre / lmv / lmv_obd.c
index 0441c14..7ab2c43 100644 (file)
@@ -80,6 +80,7 @@ static int lmv_connect_fake(struct lustre_handle *conn,
                             struct obd_uuid *cluuid)
 {
         struct lmv_obd *lmv = &obd->u.lmv;
+        struct obd_export *exp;
         int rc;
         ENTRY;
 
@@ -89,11 +90,18 @@ static int lmv_connect_fake(struct lustre_handle *conn,
                 RETURN(rc);
         }
 
-        lmv->exp = class_conn2export(conn);
-        LASSERT(lmv->exp != NULL);
+        exp = class_conn2export(conn);
+        /* We don't want to actually do the underlying connections more than
+         * once, so keep track. */
+        lmv->refcount++;
+        if (lmv->refcount > 1) {
+                class_export_put(exp);
+                RETURN(0);
+        }
 
         lmv->cluuid = *cluuid;
         lmv->connected = 0;
+        lmv->exp = exp;
 
         RETURN(0);
 }
@@ -116,14 +124,6 @@ int lmv_connect(struct obd_device *obd)
         CDEBUG(D_OTHER, "time to connect %s to %s\n",
                         cluuid->uuid, obd->obd_name);
 
-        /* We don't want to actually do the underlying connections more than
-         * once, so keep track. */
-        lmv->refcount++;
-        if (lmv->refcount > 1) {
-                class_export_put(exp);
-                RETURN(0);
-        }
-
         for (i = 0, tgts = lmv->tgts; i < lmv->count; i++, tgts++) {
                 struct obd_device *tgt_obd;
                 struct obd_uuid lmv_osc_uuid = { "LMV_OSC_UUID" };