spin_unlock(&imp->imp_lock);
CERROR("already connected\n");
RETURN(0);
- } else if (imp->imp_state == LUSTRE_IMP_CONNECTING) {
+ } else if (imp->imp_state == LUSTRE_IMP_CONNECTING ||
+ imp->imp_connected) {
spin_unlock(&imp->imp_lock);
CERROR("already connecting\n");
RETURN(-EALREADY);
ptlrpc_maybe_ping_import_soon(imp);
GOTO(out, rc);
}
+
+ /* LU-7558: indicate that we are interpretting connect reply,
+ * pltrpc_connect_import() will not try to reconnect until
+ * interpret will finish. */
+ imp->imp_connected = 1;
spin_unlock(&imp->imp_lock);
- LASSERT(imp->imp_conn_current);
+ LASSERT(imp->imp_conn_current);
- msg_flags = lustre_msg_get_op_flags(request->rq_repmsg);
+ msg_flags = lustre_msg_get_op_flags(request->rq_repmsg);
ret = req_capsule_get_size(&request->rq_pill, &RMF_CONNECT_DATA,
RCL_SERVER);
obd2cli_tgt(imp->imp_obd),
imp->imp_connection->c_remote_uuid.uuid);
ptlrpc_connect_import(imp);
+ spin_lock(&imp->imp_lock);
+ imp->imp_connected = 0;
imp->imp_connect_tried = 1;
+ spin_unlock(&imp->imp_lock);
RETURN(0);
}
out:
+ spin_lock(&imp->imp_lock);
+ imp->imp_connected = 0;
imp->imp_connect_tried = 1;
+ spin_unlock(&imp->imp_lock);
if (rc != 0) {
IMPORT_SET_STATE(imp, LUSTRE_IMP_DISCON);