struct obd_connect_data *data, *tmpdata;
int size, tmpsize;
lnet_nid_t *client_nid = NULL;
- bool mne_swab_client_ver;
ENTRY;
OBD_RACE(OBD_FAIL_TGT_CONN_RACE);
if (rc)
GOTO(out, rc);
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 6, 50, 0)
- /* Check if the client might be missing the LU-1252 fix to swab
- * the IR mne_length entries. Do this as early as possible in case
- * the version code is modified. See LU-1644 for details. */
- mne_swab_client_ver = OBD_OCD_VERSION_MAJOR(data->ocd_version) == 2 &&
- OBD_OCD_VERSION_MINOR(data->ocd_version) == 2 &&
- OBD_OCD_VERSION_PATCH(data->ocd_version) < 55;
-#endif
-
if (lustre_msg_get_op_flags(req->rq_reqmsg) & MSG_CONNECT_LIBCLIENT) {
if (!data) {
DEBUG_REQ(D_WARNING, req, "Refusing old (unversioned) "
* OBD_CONNECT_MNE_SWAB flag around forever, just so long as we need
* interop with unpatched 2.2 clients. For newer clients, servers
* will never do MNE swabbing, let the client handle that. LU-1644 */
- export->exp_need_mne_swab =
- !(data->ocd_connect_flags & OBD_CONNECT_MNE_SWAB) &&
- mne_swab_client_ver && !ptlrpc_req_need_swab(req);
+ export->exp_need_mne_swab = !ptlrpc_req_need_swab(req) &&
+ !(data->ocd_connect_flags & OBD_CONNECT_MNE_SWAB);
#else
#warning "LU-1644: Remove old OBD_CONNECT_MNE_SWAB fixup and exp_need_mne_swab"
#endif
}
mne_swab = !!ptlrpc_rep_need_swab(req);
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 6, 50, 0)
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 2, 50, 0)
/* This import flag means the server did an extra swab of IR MNE
* records (fixed in LU-1252), reverse it here if needed. LU-1644 */
if (unlikely(req->rq_import->imp_need_mne_swab))
mne_swab = !mne_swab;
#else
-#warning "LU-1644: Remove old OBD_CONNECT_MNE_SWAB fixup and exp_need_mne_swab"
+#warning "LU-1644: Remove old OBD_CONNECT_MNE_SWAB fixup and imp_need_mne_swab"
#endif
for (i = 0; i < nrpages && ealen > 0; i++) {
/* check if we need to consume remaining bytes. */
if (last_in_unit != NULL && bytes_in_unit) {
-#
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 6, 50, 0)
/* May need to swab back to update the length.*/
if (exp->exp_need_mne_swab)
/* We connect to the MGS at setup, and don't disconnect until cleanup */
data->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_AT |
- OBD_CONNECT_FULL20 | OBD_CONNECT_IMP_RECOV |
- OBD_CONNECT_MNE_SWAB;
+ OBD_CONNECT_FULL20 | OBD_CONNECT_IMP_RECOV;
+
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 2, 50, 0)
+ data->ocd_connect_flags |= OBD_CONNECT_MNE_SWAB;
+#else
+#warning "LU-1644: Remove old OBD_CONNECT_MNE_SWAB fixup and imp_need_mne_swab"
+#endif
+
if (lmd_is_client(lsi->lsi_lmd) &&
lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR)
data->ocd_connect_flags &= ~OBD_CONNECT_IMP_RECOV;
/* Reset connect flags to the originally requested flags, in case
* the server is updated on-the-fly we will get the new features. */
imp->imp_connect_data.ocd_connect_flags = imp->imp_connect_flags_orig;
+ /* Reset ocd_version each time so the server knows the exact versions */
+ imp->imp_connect_data.ocd_version = LUSTRE_VERSION_CODE;
imp->imp_msghdr_flags &= ~MSGHDR_AT_SUPPORT;
imp->imp_msghdr_flags &= ~MSGHDR_CKSUM_INCOMPAT18;
newer : older, LUSTRE_VERSION_STRING);
}
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 6, 50, 0)
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 2, 50, 0)
/* Check if server has LU-1252 fix applied to not always swab
* the IR MNE entries. Do this only once per connection. This
* fixup is version-limited, because we don't want to carry the
else /* clear if server was upgraded since last connect */
imp->imp_need_mne_swab = 0;
#else
-#warning "LU-1644: Remove old OBD_CONNECT_MNE_SWAB fixup and exp_need_mne_swab"
+#warning "LU-1644: Remove old OBD_CONNECT_MNE_SWAB fixup and imp_need_mne_swab"
#endif
if (ocd->ocd_connect_flags & OBD_CONNECT_CKSUM) {