Whamcloud - gitweb
LU-10531 gss: fix GSS support for DNE 84/30984/2
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 23 Jan 2018 12:33:52 +0000 (21:33 +0900)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 6 Feb 2018 04:25:31 +0000 (04:25 +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().

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I029dbfc52eeabb2c6f0f6d2c972ceea1879405e7
Reviewed-on: https://review.whamcloud.com/30984
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/ptlrpc/gss/gss_internal.h

index 84ab236..fc53579 100644 (file)
@@ -123,18 +123,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;
+       }
 }
 
 /*