From f0c919b7c1895134665680a816a36eeaac59841d Mon Sep 17 00:00:00 2001 From: James Nunez Date: Mon, 22 Sep 2014 16:50:59 -0600 Subject: [PATCH] LU-5329 mgs: Remove nibtbl swab code for 2.2 clients Remove obsolete code that allows compatibility with Lustre 2.2 clients. Due to a bug, Lustre 2.2 clients always swab nidtbl entries even if the server and client are using the same endian. The fix was to allow the servers to do the swabbing for the client. Now, clients will do the swabbing. Signed-off-by: James Nunez Change-Id: I420ca986c0a68343be07272bb419cbdb1cebf148 Reviewed-on: http://review.whamcloud.com/12010 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Jinshan Xiong --- lustre/ldlm/ldlm_lib.c | 22 ++++------------------ lustre/mgs/mgs_nids.c | 29 +++++++---------------------- 2 files changed, 11 insertions(+), 40 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 55dfaf0..3db7adc 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1057,25 +1057,11 @@ dont_check_exports: rc = obd_reconnect(req->rq_svc_thread->t_env, export, target, &cluuid, data, client_nid); } - if (rc) - GOTO(out, rc); - -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 6, 53, 0) - /* 2.2.0 clients always swab nidtbl entries due to a bug, so server - * will do the swabbing for if the client is using the same endianness. - * - * This fixup is version-limited, because we don't want to carry the - * 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 */ - spin_lock(&export->exp_lock); - export->exp_need_mne_swab = !ptlrpc_req_need_swab(req) && - !(data->ocd_connect_flags & OBD_CONNECT_MNE_SWAB); - spin_unlock(&export->exp_lock); -#endif + if (rc) + GOTO(out, rc); - LASSERT(target->u.obt.obt_magic == OBT_MAGIC); - data->ocd_instance = target->u.obt.obt_instance; + LASSERT(target->u.obt.obt_magic == OBT_MAGIC); + data->ocd_instance = target->u.obt.obt_instance; /* Return only the parts of obd_connect_data that we understand, so the * client knows that we don't understand the rest. */ diff --git a/lustre/mgs/mgs_nids.c b/lustre/mgs/mgs_nids.c index bc006c9..b376807 100644 --- a/lustre/mgs/mgs_nids.c +++ b/lustre/mgs/mgs_nids.c @@ -136,16 +136,7 @@ static int mgs_nidtbl_read(struct obd_export *exp, struct mgs_nidtbl *tbl, /* 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, 53, 0) - /* May need to swab back to update the length.*/ - if (exp->exp_need_mne_swab) - lustre_swab_mgs_nidtbl_entry(last_in_unit); -#endif last_in_unit->mne_length += bytes_in_unit; -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 6, 53, 0) - if (exp->exp_need_mne_swab) - lustre_swab_mgs_nidtbl_entry(last_in_unit); -#endif rc += bytes_in_unit; buf += bytes_in_unit; last_in_unit = NULL; @@ -188,19 +179,13 @@ static int mgs_nidtbl_read(struct obd_export *exp, struct mgs_nidtbl *tbl, entry->mne_type = tgt->mnt_type; entry->mne_nid_type = 0; entry->mne_nid_size = sizeof(lnet_nid_t); - entry->mne_nid_count = mti->mti_nid_count; - memcpy(entry->u.nids, mti->mti_nids, - mti->mti_nid_count * sizeof(lnet_nid_t)); - -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 6, 53, 0) - /* For LU-1644, swab entry for 2.2 clients. */ - if (exp->exp_need_mne_swab) - lustre_swab_mgs_nidtbl_entry(entry); -#endif - - version = tgt->mnt_version; - rc += entry_len; - buf += entry_len; + entry->mne_nid_count = mti->mti_nid_count; + memcpy(entry->u.nids, mti->mti_nids, + mti->mti_nid_count * sizeof(lnet_nid_t)); + + version = tgt->mnt_version; + rc += entry_len; + buf += entry_len; bytes_in_unit -= entry_len; last_in_unit = entry; -- 1.8.3.1