From: ericm Date: Wed, 12 Mar 2008 21:05:40 +0000 (+0000) Subject: branch: HEAD X-Git-Tag: v1_7_0_51~130 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=6957329b064f72db289ae93d0a7776cb9faa3961;p=fs%2Flustre-release.git branch: HEAD ptlrpc connect with V2 message format. --- diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 3b2ab47..14bbf0c 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -953,9 +953,13 @@ dont_check_exports: 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, diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index f71a33f..1bbd7de 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -861,9 +861,9 @@ struct obd_import *class_new_import(struct obd_device *obd) 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; } diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index 9d06364..17fb8cb 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -636,14 +636,8 @@ static int ptlrpc_connect_interpret(struct ptlrpc_request *request, 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);