From 14a0bc1ae259636b9e47a7cef8bf58059773f3f8 Mon Sep 17 00:00:00 2001 From: ericm Date: Sat, 9 Jul 2005 16:04:16 +0000 Subject: [PATCH] adjust gss timeout valud, don't use fixed value. --- lustre/sec/gss/sec_gss.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/lustre/sec/gss/sec_gss.c b/lustre/sec/gss/sec_gss.c index 8bd4f02..6244909 100644 --- a/lustre/sec/gss/sec_gss.c +++ b/lustre/sec/gss/sec_gss.c @@ -76,23 +76,34 @@ struct rpc_clnt; #include "gss_internal.h" #include "gss_api.h" +#define LUSTRE_PIPEDIR "/lustre" + #define GSS_CREDCACHE_EXPIRE (30 * 60) /* 30 minute */ -/* not used now */ -#if 0 -#define GSS_CRED_EXPIRE (8 * 60 * 60) /* 8 hours */ -#define GSS_CRED_SIGN_SIZE (1024) -#define GSS_CRED_VERIFY_SIZE (56) -#endif -#define LUSTRE_PIPEDIR "/lustre" +#define GSS_TIMEOUT_DELTA (5) +#define CRED_REFRESH_UPCALL_TIMEOUT \ + ({ \ + int timeout = obd_timeout - GSS_TIMEOUT_DELTA; \ + \ + if (timeout < GSS_TIMEOUT_DELTA * 2) \ + timeout = GSS_TIMEOUT_DELTA * 2; \ + timeout; \ + }) +#define SECINIT_RPC_TIMEOUT \ + ({ \ + int timeout = CRED_REFRESH_UPCALL_TIMEOUT - \ + GSS_TIMEOUT_DELTA; \ + if (timeout < GSS_TIMEOUT_DELTA) \ + timeout = GSS_TIMEOUT_DELTA; \ + timeout; \ + }) +#define SECFINI_RPC_TIMEOUT (GSS_TIMEOUT_DELTA) + /********************************************** * gss security init/fini helper * **********************************************/ -#define SECINIT_RPC_TIMEOUT (30) -#define SECFINI_RPC_TIMEOUT (10) - static int secinit_compose_request(struct obd_import *imp, char *buf, int bufsize, int lustre_srv, @@ -701,7 +712,6 @@ err_free_ctx: * cred APIs * ***************************************/ #ifdef __KERNEL__ -#define CRED_REFRESH_UPCALL_TIMEOUT (50) static int gss_cred_refresh(struct ptlrpc_cred *cred) { struct obd_import *import; -- 1.8.3.1