Whamcloud - gitweb
branch: HEAD
authorericm <ericm>
Wed, 12 Mar 2008 21:05:40 +0000 (21:05 +0000)
committerericm <ericm>
Wed, 12 Mar 2008 21:05:40 +0000 (21:05 +0000)
ptlrpc connect with V2 message format.

lustre/ldlm/ldlm_lib.c
lustre/obdclass/genops.c
lustre/ptlrpc/import.c

index 3b2ab47..14bbf0c 100644 (file)
@@ -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,
index f71a33f..1bbd7de 100644 (file)
@@ -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;
 }
index 9d06364..17fb8cb 100644 (file)
@@ -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);