From 7327f66c2ca1d9762f6ea722f1433e4435f0a5b5 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Tue, 23 Jan 2018 21:33:52 +0900 Subject: [PATCH] LU-10531 gss: fix GSS support for DNE 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 Change-Id: I029dbfc52eeabb2c6f0f6d2c972ceea1879405e7 Reviewed-on: https://review.whamcloud.com/30984 Reviewed-by: James Simmons Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/ptlrpc/gss/gss_internal.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lustre/ptlrpc/gss/gss_internal.h b/lustre/ptlrpc/gss/gss_internal.h index 84ab236..fc53579 100644 --- a/lustre/ptlrpc/gss/gss_internal.h +++ b/lustre/ptlrpc/gss/gss_internal.h @@ -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; + } } /* -- 1.8.3.1