Whamcloud - gitweb
Branch HEAD
authorwangdi <wangdi>
Fri, 4 Jul 2008 16:20:31 +0000 (16:20 +0000)
committerwangdi <wangdi>
Fri, 4 Jul 2008 16:20:31 +0000 (16:20 +0000)
check import before put it.
b=15684
i=adilger

lustre/obdclass/genops.c
lustre/ptlrpc/recov_thread.c

index 2bb7514..9e4a7f5 100644 (file)
@@ -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)
 {
index 5d002c8..cb06039 100644 (file)
@@ -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);
 }