Whamcloud - gitweb
b=11694
[fs/lustre-release.git] / lustre / ptlrpc / import.c
index cb0209d..3276811 100644 (file)
@@ -200,6 +200,8 @@ void ptlrpc_invalidate_import(struct obd_import *imp)
         struct l_wait_info lwi;
         int rc;
 
+        atomic_inc(&imp->imp_inval_count);
+
         ptlrpc_deactivate_import(imp);
 
         LASSERT(imp->imp_invalid);
@@ -217,6 +219,9 @@ void ptlrpc_invalidate_import(struct obd_import *imp)
 
         obd_import_event(imp->imp_obd, imp, IMP_EVENT_INVALIDATE);
         sptlrpc_import_flush_all_ctx(imp);
+
+        atomic_dec(&imp->imp_inval_count);
+        cfs_waitq_signal(&imp->imp_recovery_waitq);
 }
 
 /* unset imp_invalid */
@@ -285,7 +290,7 @@ static int import_select_connection(struct obd_import *imp)
                                        cfs_time_current_64())) {
                         /* If we have never tried this connection since the
                            the last successful attempt, go with this one */
-                        if (cfs_time_before_64(conn->oic_last_attempt,
+                        if (cfs_time_beforeq_64(conn->oic_last_attempt,
                                                imp->imp_last_success_conn)) {
                                 imp_conn = conn;
                                 break;
@@ -559,10 +564,6 @@ static int ptlrpc_connect_interpret(struct ptlrpc_request *request,
         if (rc)
                 GOTO(out, rc);
 
-        rc = sptlrpc_cli_install_rvs_ctx(imp, request->rq_cli_ctx);
-        if (rc)
-                GOTO(out, rc);
-
         LASSERT(imp->imp_conn_current);
 
         msg_flags = lustre_msg_get_op_flags(request->rq_repmsg);
@@ -730,6 +731,7 @@ finish:
                         GOTO(out, rc = -ENODEV);
                 }
                 exp->exp_connect_flags = ocd->ocd_connect_flags;
+                imp->imp_obd->obd_self_export->exp_connect_flags = ocd->ocd_connect_flags;
                 class_export_put(exp);
 
                 obd_import_event(imp->imp_obd, imp, IMP_EVENT_OCD);
@@ -771,6 +773,8 @@ finish:
                                 ocd->ocd_brw_size >> CFS_PAGE_SHIFT;
                 }
 
+                imp->imp_obd->obd_namespace->ns_connect_flags = ocd->ocd_connect_flags;
+
                 LASSERT((cli->cl_max_pages_per_rpc <= PTLRPC_MAX_BRW_PAGES) &&
                         (cli->cl_max_pages_per_rpc > 0));
         }