Whamcloud - gitweb
LU-5329 mgs: Remove nibtbl swab code for 2.2 clients 10/12010/3
authorJames Nunez <james.a.nunez@intel.com>
Mon, 22 Sep 2014 22:50:59 +0000 (16:50 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 11 Nov 2014 11:50:51 +0000 (11:50 +0000)
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 <james.a.nunez@intel.com>
Change-Id: I420ca986c0a68343be07272bb419cbdb1cebf148
Reviewed-on: http://review.whamcloud.com/12010
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
lustre/ldlm/ldlm_lib.c
lustre/mgs/mgs_nids.c

index 55dfaf0..3db7adc 100644 (file)
@@ -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. */
index bc006c9..b376807 100644 (file)
@@ -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;