X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fptlrpc%2Flayout.c;h=eec818cd6e30f79cc7694e46817fdfebbea03cc8;hp=48338ff2c51cf251ec252407b6374efc3773710f;hb=807a40c5678109087e2c8759bd86253034804c8d;hpb=7b63a5dab65cde131627bf22d16d6e13cf259686 diff --git a/lustre/ptlrpc/layout.c b/lustre/ptlrpc/layout.c index 48338ff..eec818c 100644 --- a/lustre/ptlrpc/layout.c +++ b/lustre/ptlrpc/layout.c @@ -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); @@ -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 {