* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#define DEBUG_SUBSYSTEM S_RPC
+#include <linux/kthread.h>
#include <obd_support.h>
#include <lustre_ha.h>
#include <lustre_net.h>
UUID_STR, strlen(UUID_STR)))
*uuid_len -= strlen(UUID_STR);
}
-EXPORT_SYMBOL(deuuidify);
/**
* Returns true if import was FULL, false if import was already not
}
EXIT;
}
-EXPORT_SYMBOL(ptlrpc_fail_import);
int ptlrpc_reconnect_import(struct obd_import *imp)
{
if (rc)
GOTO(out, rc);
- rc = sptlrpc_import_sec_adapt(imp, NULL, 0);
+ rc = sptlrpc_import_sec_adapt(imp, NULL, NULL);
if (rc)
GOTO(out, rc);
request->rq_timeout = INITIAL_CONNECT_TIMEOUT;
lustre_msg_set_timeout(request->rq_reqmsg, request->rq_timeout);
- lustre_msg_add_op_flags(request->rq_reqmsg, MSG_CONNECT_NEXT_VER);
-
request->rq_no_resend = request->rq_no_delay = 1;
request->rq_send_state = LUSTRE_IMP_CONNECTING;
/* Allow a slightly larger reply for future growth compatibility */
ocd->ocd_connect_flags;
}
- if ((ocd->ocd_connect_flags & OBD_CONNECT_AT) &&
- (imp->imp_msg_magic == LUSTRE_MSG_MAGIC_V2))
+ if (ocd->ocd_connect_flags & OBD_CONNECT_AT)
/* We need a per-message support flag, because
* a. we don't know if the incoming connect reply
* supports AT or not (in reply_in_callback)
else
imp->imp_msghdr_flags &= ~MSGHDR_AT_SUPPORT;
- if ((ocd->ocd_connect_flags & OBD_CONNECT_FULL20) &&
- (imp->imp_msg_magic == LUSTRE_MSG_MAGIC_V2))
- imp->imp_msghdr_flags |= MSGHDR_CKSUM_INCOMPAT18;
- else
- imp->imp_msghdr_flags &= ~MSGHDR_CKSUM_INCOMPAT18;
+ imp->imp_msghdr_flags |= MSGHDR_CKSUM_INCOMPAT18;
return 0;
}
GOTO(out, rc = -EPROTO);
}
+ if (!(imp->imp_connect_flags_orig & OBD_CONNECT_LIGHTWEIGHT) &&
+ (imp->imp_connect_flags_orig & OBD_CONNECT_MDS_MDS) &&
+ (imp->imp_connect_flags_orig & OBD_CONNECT_FID) &&
+ (ocd->ocd_connect_flags & OBD_CONNECT_VERSION)) {
+ __u32 major = OBD_OCD_VERSION_MAJOR(ocd->ocd_version);
+ __u32 minor = OBD_OCD_VERSION_MINOR(ocd->ocd_version);
+ __u32 patch = OBD_OCD_VERSION_PATCH(ocd->ocd_version);
+
+ /* We do not support the MDT-MDT interoperations with
+ * different version MDT because of protocol changes. */
+ if (unlikely(major != LUSTRE_MAJOR ||
+ minor != LUSTRE_MINOR ||
+ abs(patch - LUSTRE_PATCH) > 3)) {
+ LCONSOLE_WARN("%s: import %p (%u.%u.%u.%u) tried the "
+ "connection to different version MDT "
+ "(%d.%d.%d.%d) %s\n",
+ imp->imp_obd->obd_name, imp, LUSTRE_MAJOR,
+ LUSTRE_MINOR, LUSTRE_PATCH, LUSTRE_FIX,
+ major, minor, patch,
+ OBD_OCD_VERSION_FIX(ocd->ocd_version),
+ imp->imp_connection->c_remote_uuid.uuid);
+
+ GOTO(out, rc = -EPROTO);
+ }
+ }
+
if (!exp) {
/* This could happen if export is cleaned during the
connect attempt */
{
struct task_struct *task;
/* bug 17802: XXX client_disconnect_export vs connect request
- * race. if client will evicted at this time, we start
+ * race. if client is evicted at this time then we start
* invalidate thread without reference to import and import can
* be freed at same time. */
class_import_get(imp);
EXIT;
}
-EXPORT_SYMBOL(ptlrpc_cleanup_imp);
/* Adaptive Timeout utils */
extern unsigned int at_min, at_max, at_history;