X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fosc%2Fosc_request.c;h=299b3c75800ea8f6b05adb7e2f07a3a903043cd3;hp=a00185f085a45aa397760d60957879ae2fa08fa9;hb=c2b64c9918cbee42b264db39c36ac6ab3c9f6a38;hpb=d0499d453f1da0ee22089c96441f0616f73e7f50 diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index a00185f..299b3c7 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -4091,12 +4091,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);