Whamcloud - gitweb
LU-10531 gss: fix GSS support for DNE 09/31209/2
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 23 Jan 2018 12:33:52 +0000 (21:33 +0900)
committerJohn L. Hammond <john.hammond@intel.com>
Fri, 9 Feb 2018 22:30:14 +0000 (22:30 +0000)
Part of the patch https://review.whamcloud.com/24236 was
inadvertently reverted by patch https://review.whamcloud.com/27823.
So re-apply missing part to have full DNE support in GSS code.

This patch is necessary because 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().

Lustre-change: https://review.whamcloud.com/30984
Lustre-commit: 7327f66c2ca1d9762f6ea722f1433e4435f0a5b5

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I029dbfc52eeabb2c6f0f6d2c972ceea1879405e7
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/31209
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/ptlrpc/gss/gss_internal.h

index 65fc5f8..95d00f5 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;
+       }
 }
 
 /*