From dd737ba721af8b438ffe6d66ed833a1aaaa9c373 Mon Sep 17 00:00:00 2001 From: ericm Date: Fri, 16 Sep 2005 07:11:57 +0000 Subject: [PATCH] hack: wait rsi really be cleaned up before module unload. --- lustre/sec/gss/svcsec_gss.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lustre/sec/gss/svcsec_gss.c b/lustre/sec/gss/svcsec_gss.c index 9c96c3c..a0e0f2a 100644 --- a/lustre/sec/gss/svcsec_gss.c +++ b/lustre/sec/gss/svcsec_gss.c @@ -1626,8 +1626,19 @@ int gss_svc_init(void) void gss_svc_exit(void) { int rc; - if ((rc = cache_unregister(&rsi_cache))) - CERROR("unregister rsi cache: %d\n", rc); + + /* XXX rsi didn't take module refcount. without really + * cleanup it we can't simply go, later user-space operations + * will certainly cause oops. + * use space might slow or stuck on something, wait it for + * a bit -- bad hack. + */ + while ((rc = cache_unregister(&rsi_cache))) { + CERROR("unregister rsi cache: %d. Try again\n", rc); + schedule_timeout(2 * HZ); + cache_purge(&rsi_cache); + } + if ((rc = cache_unregister(&rsc_cache))) CERROR("unregister rsc cache: %d\n", rc); if ((rc = svcsec_unregister(&svcsec_gss))) -- 1.8.3.1