Whamcloud - gitweb
Port from b1_5, cleanup the client import manually if no connect to mdt/ost.
authorfanyong <fanyong>
Tue, 5 Dec 2006 15:30:38 +0000 (15:30 +0000)
committerfanyong <fanyong>
Tue, 5 Dec 2006 15:30:38 +0000 (15:30 +0000)
(found when client mount failed for permission)

lustre/mdc/mdc_request.c
lustre/osc/osc_request.c

index bb22de4..84218e7 100644 (file)
@@ -1496,6 +1496,17 @@ static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
         switch (stage) {
         case OBD_CLEANUP_EARLY:
         case OBD_CLEANUP_EXPORTS:
+                /* If we set up but never connected, the
+                   client import will not have been cleaned. */
+                if (obd->u.cli.cl_import) {
+                        struct obd_import *imp;
+                        imp = obd->u.cli.cl_import;
+                        CERROR("client import never connected\n");
+                        ptlrpc_invalidate_import(imp);
+                        ptlrpc_free_rq_pool(imp->imp_rq_pool);
+                        class_destroy_import(imp);
+                        obd->u.cli.cl_import = NULL;
+                }
                 break;
         case OBD_CLEANUP_SELF_EXP:
                 rc = obd_llog_finish(obd, 0);
index 5c1355f..623e1f2 100644 (file)
@@ -3487,8 +3487,20 @@ static int osc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
                 ptlrpc_deactivate_import(imp);
                 break;
         }
-        case OBD_CLEANUP_EXPORTS:
+        case OBD_CLEANUP_EXPORTS: {
+                /* If we set up but never connected, the
+                   client import will not have been cleaned. */
+                if (obd->u.cli.cl_import) {
+                        struct obd_import *imp;
+                        imp = obd->u.cli.cl_import;
+                        CERROR("client import never connected\n");
+                        ptlrpc_invalidate_import(imp);
+                        ptlrpc_free_rq_pool(imp->imp_rq_pool);
+                        class_destroy_import(imp);
+                        obd->u.cli.cl_import = NULL;
+                }
                 break;
+        }
         case OBD_CLEANUP_SELF_EXP:
                 rc = obd_llog_finish(obd, 0);
                 if (rc != 0)