Whamcloud - gitweb
LU-10756 osp: properly order sysfs registration 64/35464/4
authorJames Simmons <uja.ornl@yahoo.com>
Thu, 11 Jul 2019 01:08:48 +0000 (21:08 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 15 Aug 2019 07:52:10 +0000 (07:52 +0000)
When generating udev events for import states I found that the
order of setting up the sysfs tree for osp was important. Setup
the osp obd device sysfs tree before lwp sysfs device. Always
call client_obd_cleanup() first on shutdown.

Change-Id: I29257f3e91f10f8266509b535e36cc8b62ce2362
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/35464
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osp/lwp_dev.c
lustre/osp/osp_dev.c

index f6277d3..829555e 100644 (file)
@@ -260,18 +260,19 @@ static int lwp_init0(const struct lu_env *env, struct lwp_device *lwp,
                RETURN(rc);
        }
 
-       rc = lwp_setup(env, lwp, lustre_cfg_string(cfg, 1));
+       rc = lprocfs_obd_setup(lwp->lpd_obd, true);
        if (rc) {
-               CERROR("%s: setup lwp failed. %d\n",
+               CERROR("%s: lprocfs_obd_setup failed. %d\n",
                       lwp->lpd_obd->obd_name, rc);
                ptlrpcd_decref();
                RETURN(rc);
        }
 
-       rc = lprocfs_obd_setup(lwp->lpd_obd, true);
+       rc = lwp_setup(env, lwp, lustre_cfg_string(cfg, 1));
        if (rc) {
-               CERROR("%s: lprocfs_obd_setup failed. %d\n",
+               CERROR("%s: setup lwp failed. %d\n",
                       lwp->lpd_obd->obd_name, rc);
+               lprocfs_obd_cleanup(lwp->lpd_obd);
                ptlrpcd_decref();
                RETURN(rc);
        }
@@ -380,11 +381,11 @@ static struct lu_device *lwp_device_fini(const struct lu_env *env,
                class_disconnect(m->lpd_exp);
 
        LASSERT(m->lpd_obd);
-       ptlrpc_lprocfs_unregister_obd(m->lpd_obd);
-
        rc = client_obd_cleanup(m->lpd_obd);
        LASSERTF(rc == 0, "error %d\n", rc);
 
+       ptlrpc_lprocfs_unregister_obd(m->lpd_obd);
+
        ptlrpcd_decref();
 
        RETURN(NULL);
index f45cd74..dc3249b 100644 (file)
@@ -1339,7 +1339,6 @@ static struct lu_device *osp_device_fini(const struct lu_env *env,
        }
 
        LASSERT(osp->opd_obd);
-       osp_tunables_fini(osp);
 
        rc = client_obd_cleanup(osp->opd_obd);
        if (rc != 0) {
@@ -1347,6 +1346,8 @@ static struct lu_device *osp_device_fini(const struct lu_env *env,
                RETURN(ERR_PTR(rc));
        }
 
+       osp_tunables_fini(osp);
+
        ptlrpcd_decref();
 
        RETURN(NULL);