Whamcloud - gitweb
LU-1804 tests: skip OI scrub speed test under UP env
[fs/lustre-release.git] / lustre / ofd / ofd_dev.c
index b3c582b..ac87ce5 100644 (file)
@@ -88,12 +88,6 @@ static int ofd_stack_init(const struct lu_env *env,
                RETURN(-ENODEV);
        }
 
-       rc = lu_env_refill((struct lu_env *)env);
-       if (rc != 0) {
-               CERROR("Failure to refill session: '%d'\n", rc);
-               GOTO(out_type, rc);
-       }
-
        ldt = type->typ_lu;
        if (ldt == NULL) {
                CERROR("type: '%s'\n", s2lsi(lmi->lmi_sb)->lsi_osd_type);
@@ -115,6 +109,13 @@ static int ofd_stack_init(const struct lu_env *env,
                 "%s-osd", lustre_cfg_string(cfg, 0));
 
        type->typ_refcnt++;
+
+       rc = lu_env_refill((struct lu_env *)env);
+       if (rc != 0) {
+               CERROR("Failure to refill session: '%d'\n", rc);
+               GOTO(out_free, rc);
+       }
+
        rc = ldt->ldt_ops->ldto_device_init(env, d, dev, NULL);
        if (rc) {
                CERROR("can't init device '%s', rc = %d\n",