Whamcloud - gitweb
LU-8880 gss: fix GSS support for DNE 36/24236/3
authorSebastien Buisson <sbuisson@ddn.com>
Thu, 8 Dec 2016 13:10:59 +0000 (14:10 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 14 Mar 2017 02:58:37 +0000 (02:58 +0000)
With DNE, an OSP can be used on MDT for connections to other MDTs.
So to determine exactly every connection's purpose, use client_obd's
cl_sp_to in import_to_gss_svc() and gss_svc_upcall_install_rvs_ctx().

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I84934010102bdf760d07796866272b359bf0465e
Reviewed-on: https://review.whamcloud.com/24236
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
lustre/ptlrpc/gss/gss_internal.h
lustre/ptlrpc/gss/gss_svc_upcall.c

index 1bf23ed..5558176 100644 (file)
@@ -124,18 +124,24 @@ enum ptlrpc_gss_header_flags {
 static inline
 __u32 import_to_gss_svc(struct obd_import *imp)
 {
-       const char *name = imp->imp_obd->obd_type->typ_name;
+       int cl_sp_to = LUSTRE_SP_ANY;
 
-       if (!strcmp(name, LUSTRE_MGC_NAME))
-               return LUSTRE_GSS_TGT_MGS;
-       if (!strcmp(name, LUSTRE_MDC_NAME) ||
-           !strcmp(name, LUSTRE_LWP_NAME))
+       if (imp->imp_obd)
+               cl_sp_to = imp->imp_obd->u.cli.cl_sp_to;
+
+       switch (cl_sp_to) {
+       case LUSTRE_SP_MDT:
                return LUSTRE_GSS_TGT_MDS;
-       if (!strcmp(name, LUSTRE_OSC_NAME) ||
-           !strcmp(name, LUSTRE_OSP_NAME))
+       case LUSTRE_SP_OST:
                return LUSTRE_GSS_TGT_OSS;
-
-       return 0;
+       case LUSTRE_SP_MGC:
+       case LUSTRE_SP_MGS:
+               return LUSTRE_GSS_TGT_MGS;
+       case LUSTRE_SP_CLI:
+       case LUSTRE_SP_ANY:
+       default:
+               return 0;
+       }
 }
 
 /*
index 245e0e7..e655aa1 100644 (file)
@@ -839,12 +839,18 @@ int gss_svc_upcall_install_rvs_ctx(struct obd_import *imp,
         }
         rsci.h.expiry_time = (time_t) ctx_expiry;
 
-        if (strcmp(imp->imp_obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0)
-                rsci.ctx.gsc_usr_mds = 1;
-        else if (strcmp(imp->imp_obd->obd_type->typ_name, LUSTRE_OSC_NAME) == 0)
-                rsci.ctx.gsc_usr_oss = 1;
-        else
-                rsci.ctx.gsc_usr_root = 1;
+       switch (imp->imp_obd->u.cli.cl_sp_to) {
+       case LUSTRE_SP_MDT:
+               rsci.ctx.gsc_usr_mds = 1;
+               break;
+       case LUSTRE_SP_OST:
+               rsci.ctx.gsc_usr_oss = 1;
+               break;
+       case LUSTRE_SP_CLI:
+               rsci.ctx.gsc_usr_root = 1;
+       default:
+               break;
+       }
 
         rscp = rsc_update(&rsci, rscp);
         if (rscp == NULL)