Whamcloud - gitweb
Branch HEAD
authorhuanghua <huanghua>
Wed, 4 Mar 2009 16:44:38 +0000 (16:44 +0000)
committerhuanghua <huanghua>
Wed, 4 Mar 2009 16:44:38 +0000 (16:44 +0000)
b=18471
i=tom.wang
i=yong.fan

do not call lprocfs_obd_cleanup() in lu_device_fini():
it will be called later respectively in its obd_cleanup().

lustre/mdt/mdt_handler.c
lustre/obdclass/lprocfs_status.c
lustre/obdclass/lu_object.c

index 2212bff..d84f3f6 100644 (file)
@@ -4348,16 +4348,6 @@ static void mdt_fini(const struct lu_env *env, struct mdt_device *m)
         mdt_seq_fini(env, m);
         mdt_seq_fini_cli(m);
         mdt_fld_fini(env, m);
-        mdt_procfs_fini(m);
-        if (obd->obd_proc_exports_entry) {
-                lprocfs_remove_proc_entry("clear", obd->obd_proc_exports_entry);
-                obd->obd_proc_exports_entry = NULL;
-        }
-        lprocfs_free_per_client_stats(obd);
-        lprocfs_free_obd_stats(obd);
-        ptlrpc_lprocfs_unregister_obd(d->ld_obd);
-        lprocfs_obd_cleanup(d->ld_obd);
-
         sptlrpc_rule_set_free(&m->mdt_sptlrpc_rset);
 
         next->md_ops->mdo_init_capa_ctxt(env, next, 0, 0, 0, NULL);
@@ -4369,6 +4359,16 @@ static void mdt_fini(const struct lu_env *env, struct mdt_device *m)
          */
         mdt_stack_fini(env, m, md2lu_dev(m->mdt_child));
 
+        mdt_procfs_fini(m);
+        if (obd->obd_proc_exports_entry) {
+                lprocfs_remove_proc_entry("clear", obd->obd_proc_exports_entry);
+                obd->obd_proc_exports_entry = NULL;
+        }
+        lprocfs_free_per_client_stats(obd);
+        lprocfs_free_obd_stats(obd);
+        ptlrpc_lprocfs_unregister_obd(obd);
+        lprocfs_obd_cleanup(obd);
+
         if (ls) {
                 struct md_site *mite;
 
index 5c71a1f..239b00d 100644 (file)
@@ -888,7 +888,10 @@ int lprocfs_obd_cleanup(struct obd_device *obd)
                 lprocfs_remove(&obd->obd_proc_exports_entry);
                 obd->obd_proc_exports_entry = NULL;
         }
-        lprocfs_remove(&obd->obd_proc_entry);
+        if (obd->obd_proc_entry) {
+                lprocfs_remove(&obd->obd_proc_entry);
+                obd->obd_proc_entry = NULL;
+        }
         return 0;
 }
 
index d5f6f5c..4fd6f0d 100644 (file)
@@ -845,8 +845,6 @@ void lu_device_fini(struct lu_device *d)
 
         t = d->ld_type;
         if (d->ld_obd != NULL) {
-                /* finish lprocfs */
-                lprocfs_obd_cleanup(d->ld_obd);
                 d->ld_obd->obd_lu_dev = NULL;
                 d->ld_obd = NULL;
         }