From 26a5dff967c99245eac01f00288e707513c58a98 Mon Sep 17 00:00:00 2001 From: huanghua Date: Wed, 4 Mar 2009 16:44:38 +0000 Subject: [PATCH] Branch HEAD 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 | 20 ++++++++++---------- lustre/obdclass/lprocfs_status.c | 5 ++++- lustre/obdclass/lu_object.c | 2 -- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 2212bff..d84f3f6 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -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; diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 5c71a1f..239b00d 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -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; } diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index d5f6f5c..4fd6f0d 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -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; } -- 1.8.3.1