From 9cf9b55e98496a66c882e821ff5a3a1e32e26543 Mon Sep 17 00:00:00 2001 From: ericm Date: Tue, 21 Nov 2006 01:01:31 +0000 Subject: [PATCH] branch: b_new_cmd more fix to gss module loading: waiting init channel be opened in gss module itself. --- lustre/ptlrpc/gss/gss_svc_upcall.c | 22 +++++++++++++++++++++- lustre/ptlrpc/sec.c | 9 --------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/lustre/ptlrpc/gss/gss_svc_upcall.c b/lustre/ptlrpc/gss/gss_svc_upcall.c index 776ae06..ce49c96 100644 --- a/lustre/ptlrpc/gss/gss_svc_upcall.c +++ b/lustre/ptlrpc/gss/gss_svc_upcall.c @@ -956,8 +956,28 @@ void gss_svc_upcall_destroy_ctx(struct gss_svc_ctx *ctx) int __init gss_svc_init_upcall(void) { - cache_register(&rsc_cache); + int i; + cache_register(&rsi_cache); + cache_register(&rsc_cache); + + /* FIXME this looks stupid. we intend to give lsvcgssd a chance to open + * the init upcall channel, otherwise there's big chance that the first + * upcall issued before the channel be opened thus nfsv4 cache code will + * drop the request direclty, thus lead to unnecessary recovery time. + * here we wait at miximum 1.5 seconds. + */ + for (i = 0; i < 6; i++) { + if (atomic_read(&rsi_cache.readers) > 0) + break; + set_current_state(TASK_UNINTERRUPTIBLE); + LASSERT(HZ >= 4); + schedule_timeout(HZ / 4); + } + + if (atomic_read(&rsi_cache.readers) == 0) + CWARN("init channel is not opened by lsvcgssd, following " + "request might be dropped until lsvcgssd be active\n"); return 0; } diff --git a/lustre/ptlrpc/sec.c b/lustre/ptlrpc/sec.c index b43df11..15aa3fd 100644 --- a/lustre/ptlrpc/sec.c +++ b/lustre/ptlrpc/sec.c @@ -133,15 +133,6 @@ again: else CWARN("module ptlrpc_gss loaded\n"); - /* this is stupid. we intend to give lsvcgssd a chance - * to open the upcall channel, otherwise there's big - * chance the first upcall issued before the channel be - * opened thus nfsv4 cache code will drop the call - * direclty. FIXME - */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(2 * HZ); - atomic_set(&loaded, 1); } mutex_up(&load_mutex); -- 1.8.3.1