Whamcloud - gitweb
Updated content to point to valid wiki page.
[fs/lustre-release.git] / lustre / ptlrpc / gss / gss_svc_upcall.c
index f76c22d..ba9e808 100644 (file)
@@ -3,11 +3,8 @@
  *
  * Modifications for Lustre
  *
- * Copyright 2008, Sun Microsystems, Inc.
- * Author: Eric Mei <eric.mei@sun.com>
+ * Copyright  2008 Sun Microsystems, Inc. All rights reserved
  *
- * Copyright 2004 - 2006, Cluster File Systems, Inc.
- * All rights reserved
  * Author: Eric Mei <ericm@clusterfs.com>
  */
 
@@ -77,7 +74,7 @@
 
 #define GSS_SVC_UPCALL_TIMEOUT  (20)
 
-static spinlock_t __ctx_index_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t __ctx_index_lock;
 static __u64 __ctx_index;
 
 __u64 gss_get_next_ctx_index(void)
@@ -1330,7 +1327,7 @@ cache_check:
         grctx->src_init = 1;
         grctx->src_reserve_len = size_round4(rsip->out_token.len);
 
-        rc = lustre_pack_reply_v2(req, 1, &replen, NULL);
+        rc = lustre_pack_reply_v2(req, 1, &replen, NULL, 0);
         if (rc) {
                 CERROR("failed to pack reply: %d\n", rc);
                 GOTO(out, rc = SECSVC_DROP);
@@ -1419,6 +1416,16 @@ int __init gss_init_svc_upcall(void)
 {
         int     i;
 
+        spin_lock_init(&__ctx_index_lock);
+        /*
+         * this helps reducing context index confliction. after server reboot,
+         * conflicting request from clients might be filtered out by initial
+         * sequence number checking, thus no chance to sent error notification
+         * back to clients.
+         */
+        get_random_bytes(&__ctx_index, sizeof(__ctx_index));
+
+
         cache_register(&rsi_cache);
         cache_register(&rsc_cache);
 
@@ -1439,24 +1446,14 @@ int __init gss_init_svc_upcall(void)
                 CWARN("Init channel is not opened by lsvcgssd, following "
                       "request might be dropped until lsvcgssd is active\n");
 
-        /* this helps reducing context index confliction. after server reboot,
-         * conflicting request from clients might be filtered out by initial
-         * sequence number checking, thus no chance to sent error notification
-         * back to clients. */
-        get_random_bytes(&__ctx_index, sizeof(__ctx_index));
-
         return 0;
 }
 
 void __exit gss_exit_svc_upcall(void)
 {
-        int rc;
-
         cache_purge(&rsi_cache);
-        if ((rc = cache_unregister(&rsi_cache)))
-                CERROR("unregister rsi cache: %d\n", rc);
+        cache_unregister(&rsi_cache);
 
         cache_purge(&rsc_cache);
-        if ((rc = cache_unregister(&rsc_cache)))
-                CERROR("unregister rsc cache: %d\n", rc);
+        cache_unregister(&rsc_cache);
 }