From bcf6874713b37e63230b985e51851f2675e92407 Mon Sep 17 00:00:00 2001 From: shadow Date: Tue, 14 Apr 2009 18:18:17 +0000 Subject: [PATCH] revert b=18896 --- lustre/ldlm/ldlm_lib.c | 6 ------ lustre/mdc/mdc_request.c | 2 ++ lustre/osc/osc_request.c | 17 ++++++++++------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 79db4b2..d7e4b00 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -361,13 +361,7 @@ err: int client_obd_cleanup(struct obd_device *obddev) { - struct client_obd *cli = &obddev->u.cli; ENTRY; - - /* cleanup can be called for never connected obd */ - if (cli->cl_import) - class_destroy_import(cli->cl_import); - ldlm_put_ref(); RETURN(0); } diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 724c3aa..5f5742e 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1376,7 +1376,9 @@ static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) imp = obd->u.cli.cl_import; CERROR("client import never connected\n"); ptlrpc_invalidate_import(imp); + class_destroy_import(imp); up_write(&obd->u.cli.cl_sem); + obd->u.cli.cl_import = NULL; } rc = obd_llog_finish(obd, 0); if (rc != 0) diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 4cfe870..f74f672 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -4050,10 +4050,19 @@ static int osc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) /* If we set up but never connected, the client import will not have been cleaned. */ if (obd->u.cli.cl_import) { - struct obd_import *imp = obd->u.cli.cl_import; + struct obd_import *imp; + down_write(&obd->u.cli.cl_sem); + imp = obd->u.cli.cl_import; CDEBUG(D_CONFIG, "%s: client import never connected\n", obd->obd_name); ptlrpc_invalidate_import(imp); + if (imp->imp_rq_pool) { + ptlrpc_free_rq_pool(imp->imp_rq_pool); + imp->imp_rq_pool = NULL; + } + class_destroy_import(imp); + up_write(&obd->u.cli.cl_sem); + obd->u.cli.cl_import = NULL; } rc = obd_llog_finish(obd, 0); if (rc != 0) @@ -4071,7 +4080,6 @@ static int osc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) int osc_cleanup(struct obd_device *obd) { struct osc_creator *oscc = &obd->u.cli.cl_oscc; - struct obd_import *imp = obd->u.cli.cl_import; int rc; ENTRY; @@ -4087,11 +4095,6 @@ int osc_cleanup(struct obd_device *obd) lquota_cleanup(quota_interface, obd); cache_destroy(obd->u.cli.cl_cache); - if (imp && imp->imp_rq_pool) { - ptlrpc_free_rq_pool(imp->imp_rq_pool); - imp->imp_rq_pool = NULL; - } - rc = client_obd_cleanup(obd); ptlrpcd_decref(); -- 1.8.3.1