From b3f5ec55613fe6b6c858c618c4a72b2b81d03682 Mon Sep 17 00:00:00 2001 From: yury Date: Fri, 7 Nov 2008 12:31:48 +0000 Subject: [PATCH] b=17445 r=tappro,johann - adds proper locking during freeing rq pool and its requests --- lustre/osc/osc_request.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index e33d1f1..de23026 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -3946,12 +3946,17 @@ static int osc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) client import will not have been cleaned. */ if (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); - ptlrpc_free_rq_pool(imp->imp_rq_pool); + 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); -- 1.8.3.1