Whamcloud - gitweb
LU-6307 obdclass: distinguish MGC/MDT connection properly 27/13927/2
authorFan Yong <fan.yong@intel.com>
Thu, 4 Dec 2014 16:58:06 +0000 (00:58 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 3 Mar 2015 18:10:01 +0000 (18:10 +0000)
In the 5f8847bca12afb798de600299356ed2e3655a53e, we introduced the
version checking for the MDT-MDT connection. But there is a corner
that the MGC will set OBD_CONNECT_MNE_SWAB (that is defined as the
same as OBD_CONNECT_MDS_MDS) in the connection flags for Imperative
Recovery interoperability issues with MGS. So the server needs to
know whether the connection is really from another MDT or from the
MGC via checking OBD_CONNECT_FID (that is not set for the MGC-MGS
connection).

Test-Parameters: envdefinitions=ONLY=105 clientjob=lustre-b2_6 clientbuildno=19 testlist=recovery-small
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I9cee743d5474702b77adbb8c3dedd6c19faef15f
Reviewed-on: http://review.whamcloud.com/13927
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ldlm/ldlm_lib.c
lustre/ptlrpc/import.c

index 5e1f170..14a0ac7 100644 (file)
@@ -902,10 +902,14 @@ int target_handle_connect(struct ptlrpc_request *req)
                             OBD_CONNECT_LIGHTWEIGHT) != 0;
 
                /* OBD_CONNECT_MNE_SWAB is defined as OBD_CONNECT_MDS_MDS
-                * for Imperative Recovery connection from MGC to MGS. */
+                * for Imperative Recovery connection from MGC to MGS.
+                *
+                * Via check OBD_CONNECT_FID, we can distinguish whether
+                * the OBD_CONNECT_MDS_MDS/OBD_CONNECT_MNE_SWAB is from
+                * MGC or MDT. */
                if (!lw_client &&
                    (data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) &&
-                   !(data->ocd_connect_flags & OBD_CONNECT_IMP_RECOV) &&
+                   (data->ocd_connect_flags & OBD_CONNECT_FID) &&
                    (data->ocd_connect_flags & OBD_CONNECT_VERSION)) {
                        __u32 major = OBD_OCD_VERSION_MAJOR(data->ocd_version);
                        __u32 minor = OBD_OCD_VERSION_MINOR(data->ocd_version);
index 5d1e6b8..4185eff 100644 (file)
@@ -1016,7 +1016,7 @@ static int ptlrpc_connect_interpret(const struct lu_env *env,
 
        if (!(imp->imp_connect_flags_orig & OBD_CONNECT_LIGHTWEIGHT) &&
            (imp->imp_connect_flags_orig & OBD_CONNECT_MDS_MDS) &&
-           !(imp->imp_connect_flags_orig & OBD_CONNECT_IMP_RECOV) &&
+           (imp->imp_connect_flags_orig & OBD_CONNECT_FID) &&
            (ocd->ocd_connect_flags & OBD_CONNECT_VERSION)) {
                __u32 major = OBD_OCD_VERSION_MAJOR(ocd->ocd_version);
                __u32 minor = OBD_OCD_VERSION_MINOR(ocd->ocd_version);