ptlrpc connect with V2 message format.
revimp->imp_dlm_fake = 1;
revimp->imp_state = LUSTRE_IMP_FULL;
- if (lustre_msg_get_op_flags(req->rq_reqmsg) & MSG_CONNECT_NEXT_VER) {
+ 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 magic has been filtered out by unpack */
+ revimp->imp_msg_magic = req->rq_reqmsg->lm_magic;
}
rc = sptlrpc_import_sec_adapt(revimp, req->rq_svc_ctx,
CFS_INIT_LIST_HEAD(&imp->imp_handle.h_link);
class_handle_hash(&imp->imp_handle, import_handle_addref);
- /* 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;
}
spin_unlock(&imp->imp_lock);
}
- if (msg_flags & MSG_CONNECT_NEXT_VER) {
- imp->imp_msg_magic = LUSTRE_MSG_MAGIC_V2;
- CDEBUG(D_RPCTRACE, "connect to %s with lustre_msg_v2\n",
- obd2cli_tgt(imp->imp_obd));
- } else {
- CDEBUG(D_RPCTRACE, "connect to %s with lustre_msg_v1\n",
- obd2cli_tgt(imp->imp_obd));
- }
+ /* if applies, adjust the imp->imp_msg_magic here
+ * according to reply flags */
imp->imp_remote_handle =
*lustre_msg_get_handle(request->rq_repmsg);