From: wangdi Date: Fri, 4 Jul 2008 16:20:31 +0000 (+0000) Subject: Branch HEAD X-Git-Tag: v1_9_50~262 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=bd39d130f8d430524bcfded06bbc2f19769b50f8;p=fs%2Flustre-release.git Branch HEAD check import before put it. b=15684 i=adilger --- diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 2bb7514..9e4a7f5 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -808,6 +808,7 @@ void class_import_put(struct obd_import *import) EXIT; } +EXPORT_SYMBOL(class_import_put); void class_import_destroy(struct obd_import *import) { @@ -835,7 +836,6 @@ void class_import_destroy(struct obd_import *import) OBD_FREE_RCU(import, sizeof(*import), &import->imp_handle); EXIT; } -EXPORT_SYMBOL(class_import_put); struct obd_import *class_new_import(struct obd_device *obd) { diff --git a/lustre/ptlrpc/recov_thread.c b/lustre/ptlrpc/recov_thread.c index 5d002c8..cb06039 100644 --- a/lustre/ptlrpc/recov_thread.c +++ b/lustre/ptlrpc/recov_thread.c @@ -167,8 +167,10 @@ static void ctxt_llcd_put(struct llog_ctxt *ctxt) llcd_put(ctxt->loc_llcd); ctxt->loc_llcd = NULL; } - class_import_put(ctxt->loc_imp); - ctxt->loc_imp = NULL; + if (ctxt->loc_imp) { + class_import_put(ctxt->loc_imp); + ctxt->loc_imp = NULL; + } mutex_up(&ctxt->loc_sem); }