int rc = 0;
char *target_start;
int target_len;
- bool mds_conn = false, lw_client = false;
+ bool mds_conn = false, lw_client = false, initial_conn = false;
bool mds_mds_conn = false;
bool new_mds_mds_conn = false;
bool target_referenced = false;
lw_client = (data->ocd_connect_flags & OBD_CONNECT_LIGHTWEIGHT) != 0;
if (lustre_msg_get_op_flags(req->rq_reqmsg) & MSG_CONNECT_INITIAL) {
+ initial_conn = true;
mds_conn = (data->ocd_connect_flags & OBD_CONNECT_MDS) != 0;
mds_mds_conn = (data->ocd_connect_flags &
OBD_CONNECT_MDS_MDS) != 0;
class_export_put(export);
export = NULL;
rc = -EALREADY;
- } else if ((mds_conn || lw_client ||
- data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) &&
+ } else if ((mds_conn || (lw_client && initial_conn) ||
+ data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) &&
export->exp_connection != NULL) {
spin_unlock(&export->exp_lock);
if (req->rq_peer.nid != export->exp_connection->c_peer.nid) {
export = NULL;
rc = 0;
}
- } else if (export->exp_connection != NULL &&
- req->rq_peer.nid != export->exp_connection->c_peer.nid &&
- (lustre_msg_get_op_flags(req->rq_reqmsg) &
- MSG_CONNECT_INITIAL)) {
+ } else if (export->exp_connection != NULL && initial_conn &&
+ req->rq_peer.nid != export->exp_connection->c_peer.nid) {
spin_unlock(&export->exp_lock);
/* In MDS failover we have static UUID but NID can change. */
LCONSOLE_WARN("%s: Client %s seen on new nid %s when "