Whamcloud - gitweb
LU-5319 ptlrpc: Add OBD_CONNECT_MULTIMODRPCS flag
[fs/lustre-release.git] / lustre / ptlrpc / layout.c
index e11c9fe..eec818c 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 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/
@@ -1004,18 +1004,7 @@ EXPORT_SYMBOL(RMF_CONN);
 struct req_msg_field RMF_CONNECT_DATA =
        DEFINE_MSGF("cdata",
                    RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */,
-#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 53, 0)
                    sizeof(struct obd_connect_data),
-#else
-/* For interoperability with 1.8 and 2.0 clients/servers.
- * The RPC verification code allows larger RPC buffers, but not
- * smaller buffers.  Until we no longer need to keep compatibility
- * with older servers/clients we can only check that the buffer
- * size is at least as large as obd_connect_data_v1.  That is not
- * not in itself harmful, since the chance of just corrupting this
- * field is low.  See JIRA LU-16 for details. */
-                   sizeof(struct obd_connect_data_v1),
-#endif
                    lustre_swab_connect, NULL);
 EXPORT_SYMBOL(RMF_CONNECT_DATA);
 
@@ -1118,8 +1107,8 @@ struct req_msg_field RMF_EAVALS_LENS =
 EXPORT_SYMBOL(RMF_EAVALS_LENS);
 
 struct req_msg_field RMF_OBD_ID =
-        DEFINE_MSGF("obd_id", 0,
-                    sizeof(obd_id), lustre_swab_ost_last_id, NULL);
+       DEFINE_MSGF("obd_id", 0,
+                   sizeof(__u64), lustre_swab_ost_last_id, NULL);
 EXPORT_SYMBOL(RMF_OBD_ID);
 
 struct req_msg_field RMF_FID =
@@ -2002,18 +1991,19 @@ static void *__req_capsule_get(struct req_capsule *pill,
         getter = (field->rmf_flags & RMF_F_STRING) ?
                 (typeof(getter))lustre_msg_string : lustre_msg_buf;
 
-        if (field->rmf_flags & RMF_F_STRUCT_ARRAY) {
-                /*
-                 * We've already asserted that field->rmf_size > 0 in
-                 * req_layout_init().
-                 */
-                len = lustre_msg_buflen(msg, offset);
-                if ((len % field->rmf_size) != 0) {
-                        CERROR("%s: array field size mismatch "
+       if (field->rmf_flags & (RMF_F_STRUCT_ARRAY|RMF_F_NO_SIZE_CHECK)) {
+               /*
+                * We've already asserted that field->rmf_size > 0 in
+                * req_layout_init().
+                */
+               len = lustre_msg_buflen(msg, offset);
+               if (!(field->rmf_flags & RMF_F_NO_SIZE_CHECK) &&
+                   (len % field->rmf_size) != 0) {
+                       CERROR("%s: array field size mismatch "
                                "%d modulo %u != 0 (%d)\n",
                                field->rmf_name, len, field->rmf_size, loc);
-                        return NULL;
-                }
+                       return NULL;
+               }
         } else if (pill->rc_area[loc][offset] != -1) {
                 len = pill->rc_area[loc][offset];
         } else {