Skip to content
Snippets Groups Projects
Commit 5232d691 authored by huanghua's avatar huanghua
Browse files

Branch b1_6

b=14538
i=eric.mei
i=yong.fan

- use lustre_msg_v2 for CONNECT
parent 456e89ab
No related branches found
No related tags found
No related merge requests found
......@@ -901,11 +901,19 @@ int target_handle_connect(struct ptlrpc_request *req, svc_handler_t handler)
revimp->imp_remote_handle = conn;
revimp->imp_dlm_fake = 1;
revimp->imp_state = LUSTRE_IMP_FULL;
set_flags:
if (lustre_msg_get_op_flags(req->rq_reqmsg) & MSG_CONNECT_NEXT_VER) {
/* Client wants v2 */
if (req->rq_reqmsg->lm_magic == LUSTRE_MSG_MAGIC_V1 &&
lustre_msg_get_op_flags(req->rq_reqmsg) & MSG_CONNECT_NEXT_VER) {
revimp->imp_msg_magic = LUSTRE_MSG_MAGIC_V2;
lustre_msg_add_op_flags(req->rq_repmsg, MSG_CONNECT_NEXT_VER);
} else {
/* unknown versions will be caught in
* ptlrpc_handle_server_req_in->lustre_unpack_msg() */
revimp->imp_msg_magic = req->rq_reqmsg->lm_magic;
}
if (revimp->imp_msg_magic != LUSTRE_MSG_MAGIC_V1) {
if (export->exp_connect_flags & OBD_CONNECT_AT)
revimp->imp_msghdr_flags |= MSGHDR_AT_SUPPORT;
}
......
......@@ -830,9 +830,9 @@ struct obd_import *class_new_import(struct obd_device *obd)
class_handle_hash(&imp->imp_handle, import_handle_addref);
init_imp_at(&imp->imp_at);
/* the default magic is V1, will be used in connect RPC, and
/* the default magic is V2, will be used in connect RPC, and
* then adjusted according to the flags in request/reply. */
imp->imp_msg_magic = LUSTRE_MSG_MAGIC_V1;
imp->imp_msg_magic = LUSTRE_MSG_MAGIC_V2;
return imp;
}
......
......@@ -516,7 +516,9 @@ int ptlrpc_connect_import(struct obd_import *imp, char *new_uuid)
#ifndef __KERNEL__
lustre_msg_add_op_flags(request->rq_reqmsg, MSG_CONNECT_LIBCLIENT);
#endif
lustre_msg_add_op_flags(request->rq_reqmsg, MSG_CONNECT_NEXT_VER);
if (imp->imp_msg_magic == LUSTRE_MSG_MAGIC_V1)
lustre_msg_add_op_flags(request->rq_reqmsg,
MSG_CONNECT_NEXT_VER);
request->rq_send_state = LUSTRE_IMP_CONNECTING;
/* Allow a slightly larger reply for future growth compatibility */
......@@ -635,7 +637,9 @@ static int ptlrpc_connect_interpret(struct ptlrpc_request *request,
spin_unlock(&imp->imp_lock);
}
if (msg_flags & MSG_CONNECT_NEXT_VER) {
if ((request->rq_reqmsg->lm_magic == LUSTRE_MSG_MAGIC_V1 &&
msg_flags & MSG_CONNECT_NEXT_VER) ||
request->rq_reqmsg->lm_magic == LUSTRE_MSG_MAGIC_V2) {
imp->imp_msg_magic = LUSTRE_MSG_MAGIC_V2;
CDEBUG(D_RPCTRACE, "connect to %s with lustre_msg_v2\n",
obd2cli_tgt(imp->imp_obd));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment