From 1c173b1393bb4d46c60c73f85bddcd387eba6d22 Mon Sep 17 00:00:00 2001 From: tappro Date: Tue, 31 Oct 2006 20:52:04 +0000 Subject: [PATCH] take into account initial_conn value during reconnect --- lustre/include/lustre_lib.h | 2 +- lustre/ldlm/ldlm_lib.c | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lustre/include/lustre_lib.h b/lustre/include/lustre_lib.h index 2c2031e..4571040 100644 --- a/lustre/include/lustre_lib.h +++ b/lustre/include/lustre_lib.h @@ -55,7 +55,7 @@ int target_handle_connect(struct ptlrpc_request *req); int target_handle_disconnect(struct ptlrpc_request *req); void target_destroy_export(struct obd_export *exp); int target_handle_reconnect(struct lustre_handle *conn, struct obd_export *exp, - struct obd_uuid *cluuid); + struct obd_uuid *cluuid, int); int target_handle_ping(struct ptlrpc_request *req); void target_committed_to_req(struct ptlrpc_request *req); diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 47ba3ce..a233e11 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -503,10 +503,10 @@ int client_disconnect_export(struct obd_export *exp) * -------------------------------------------------------------------------- */ int target_handle_reconnect(struct lustre_handle *conn, struct obd_export *exp, - struct obd_uuid *cluuid) + struct obd_uuid *cluuid, int initial_conn) { ENTRY; - if (exp->exp_connection && exp->exp_imp_reverse) { + if (exp->exp_connection && exp->exp_imp_reverse && !initial_conn) { struct lustre_handle *hdl; hdl = &exp->exp_imp_reverse->imp_remote_handle; /* Might be a re-connect after a partition. */ @@ -651,8 +651,12 @@ int target_handle_connect(struct ptlrpc_request *req) } } - if (lustre_msg_get_op_flags(req->rq_reqmsg) & MSG_CONNECT_INITIAL) + if (lustre_msg_get_op_flags(req->rq_reqmsg) & MSG_CONNECT_INITIAL) { + CWARN("Initial connection\n"); initial_conn = 1; + } else { + CWARN("Not initial connection\n"); + } /* lctl gets a backstage, all-access pass. */ if (obd_uuid_equals(&cluuid, &target->obd_uuid)) @@ -673,7 +677,8 @@ int target_handle_connect(struct ptlrpc_request *req) spin_unlock(&target->obd_dev_lock); LASSERT(export->exp_obd == target); - rc = target_handle_reconnect(&conn, export, &cluuid); + rc = target_handle_reconnect(&conn, export, &cluuid, + initial_conn); break; } export = NULL; @@ -697,7 +702,8 @@ int target_handle_connect(struct ptlrpc_request *req) libcfs_nid2str(req->rq_peer.nid), export, atomic_read(&export->exp_rpc_count)); GOTO(out, rc = -EBUSY); - } else if (lustre_msg_get_conn_cnt(req->rq_reqmsg) == 1) { + } else if (lustre_msg_get_conn_cnt(req->rq_reqmsg) == 1 && + !initial_conn) { CERROR("%s: NID %s (%s) reconnected with 1 conn_cnt; " "cookies not random?\n", target->obd_name, libcfs_nid2str(req->rq_peer.nid), cluuid.uuid); -- 1.8.3.1