Whamcloud - gitweb
b=17466
[fs/lustre-release.git] / lustre / mds / handler.c
index 568f692..00527cb 100644 (file)
@@ -269,8 +269,9 @@ static int mds_lov_early_clean(struct obd_device *obd)
 
 static int mds_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
 {
-        int rc = 0;
         struct mds_obd *mds = &obd->u.mds;
+        struct llog_ctxt *ctxt;
+        int rc = 0;
         ENTRY;
 
         switch (stage) {
@@ -281,8 +282,12 @@ static int mds_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
                 down_write(&mds->mds_notify_lock);
                 mds_lov_disconnect(obd);
                 mds_lov_clean(obd);
-                llog_cleanup(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT));
-                llog_cleanup(llog_get_context(obd, LLOG_LOVEA_ORIG_CTXT));
+                ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
+                if (ctxt)
+                        llog_cleanup(ctxt);
+                ctxt = llog_get_context(obd, LLOG_LOVEA_ORIG_CTXT);
+                if (ctxt)
+                        llog_cleanup(ctxt);
                 rc = obd_llog_finish(obd, 0);
                 mds->mds_osc_exp = NULL;
                 up_write(&mds->mds_notify_lock);