Whamcloud - gitweb
LU-4307 kerberos: fix __exit usage and unknown symbol errors 81/8481/3
authorJames Simmons <uja.ornl@gmail.com>
Wed, 4 Dec 2013 20:03:38 +0000 (15:03 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 11 Dec 2013 14:04:26 +0000 (14:04 +0000)
For linux all functions marked with __exit should not be
called as a cleanup function in the module init functions.
This patch removes __exit from the gss module exit functions
that are being used as cleanup in the module init function.
The second issue addressed is the unknown symbols due to
gss_[init/exit]_keyring being called when HAVE_GSS_KEYRING
is not defined.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I2de7a3ade47f585f5ec1634ee55c1d2ce56f2921
Reviewed-on: http://review.whamcloud.com/8481
Tested-by: Jenkins
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Thomas Stibor <thomas@stibor.net>
Reviewed-by: Andrew Korty <ajk@iu.edu>
lustre/ptlrpc/gss/gss_cli_upcall.c
lustre/ptlrpc/gss/gss_internal.h
lustre/ptlrpc/gss/gss_krb5_mech.c
lustre/ptlrpc/gss/gss_svc_upcall.c
lustre/ptlrpc/gss/sec_gss.c

index b36c99a..086f7b4 100644 (file)
@@ -446,6 +446,6 @@ int __init gss_init_cli_upcall(void)
         return 0;
 }
 
-void __exit gss_exit_cli_upcall(void)
+void gss_exit_cli_upcall(void)
 {
 }
index 06f519b..301413e 100644 (file)
@@ -427,12 +427,22 @@ int gss_cli_ctx_fini_common(struct ptlrpc_sec *sec,
 void gss_cli_ctx_flags2str(unsigned long flags, char *buf, int bufsize);
 
 /* gss_keyring.c */
+#ifndef HAVE_GSS_KEYRING
+static inline int  __init gss_init_keyring(void) { return 0; }
+static inline void __exit gss_exit_keyring(void) { return; }
+#else
 int  __init gss_init_keyring(void);
 void __exit gss_exit_keyring(void);
+#endif
 
 /* gss_pipefs.c */
+#ifndef HAVE_GSS_PIPEFS
+static inline int  __init gss_init_pipefs(void) { return 0; }
+static inline void __exit gss_exit_pipefs(void) { return; }
+#else
 int  __init gss_init_pipefs(void);
 void __exit gss_exit_pipefs(void);
+#endif
 
 /* gss_bulk.c */
 int gss_cli_prep_bulk(struct ptlrpc_request *req,
@@ -450,10 +460,6 @@ int gss_svc_unwrap_bulk(struct ptlrpc_request *req,
 int gss_svc_wrap_bulk(struct ptlrpc_request *req,
                       struct ptlrpc_bulk_desc *desc);
 
-/* gss_mech_switch.c */
-int init_kerberos_module(void);
-void cleanup_kerberos_module(void);
-
 /* gss_generic_token.c */
 int g_token_size(rawobj_t *mech, unsigned int body_size);
 void g_make_token_header(rawobj_t *mech, int body_size, unsigned char **buf);
@@ -466,7 +472,7 @@ int gss_do_ctx_init_rpc(char *buffer, unsigned long count);
 int gss_do_ctx_fini_rpc(struct gss_cli_ctx *gctx);
 
 int  __init gss_init_cli_upcall(void);
-void __exit gss_exit_cli_upcall(void);
+void gss_exit_cli_upcall(void);
 
 /* gss_svc_upcall.c */
 __u64 gss_get_next_ctx_index(void);
@@ -489,18 +495,18 @@ void gss_svc_upcall_put_ctx(struct gss_svc_ctx *ctx);
 void gss_svc_upcall_destroy_ctx(struct gss_svc_ctx *ctx);
 
 int  __init gss_init_svc_upcall(void);
-void __exit gss_exit_svc_upcall(void);
+void gss_exit_svc_upcall(void);
 
 /* lproc_gss.c */
 void gss_stat_oos_record_cli(int behind);
 void gss_stat_oos_record_svc(int phase, int replay);
 
 int  __init gss_init_lproc(void);
-void __exit gss_exit_lproc(void);
+void gss_exit_lproc(void);
 
 /* gss_krb5_mech.c */
 int __init init_kerberos_module(void);
-void __exit cleanup_kerberos_module(void);
+void cleanup_kerberos_module(void);
 
 
 /* debug */
index bd1114f..3cd3be5 100644 (file)
@@ -1782,7 +1782,7 @@ int __init init_kerberos_module(void)
        return status;
 }
 
-void __exit cleanup_kerberos_module(void)
+void cleanup_kerberos_module(void)
 {
         lgss_mech_unregister(&gss_kerberos_mech);
 }
index 7fcc3e8..90967ed 100644 (file)
@@ -1100,7 +1100,7 @@ int __init gss_init_svc_upcall(void)
        return 0;
 }
 
-void __exit gss_exit_svc_upcall(void)
+void gss_exit_svc_upcall(void)
 {
        cache_purge(&rsi_cache);
        cache_unregister_net(&rsi_cache, &init_net);
index 74eb470..043a683 100644 (file)
@@ -2874,21 +2874,16 @@ int __init sptlrpc_gss_init(void)
         if (rc)
                 goto out_kerberos;
 
-#ifdef HAVE_GSS_PIPEFS
         rc = gss_init_pipefs();
         if (rc)
                 goto out_keyring;
-#endif
 
         gss_init_at_reply_offset();
 
         return 0;
 
-#ifdef HAVE_GSS_PIPEFS
 out_keyring:
         gss_exit_keyring();
-#endif
-
 out_kerberos:
         cleanup_kerberos_module();
 out_svc_upcall:
@@ -2903,9 +2898,7 @@ out_lproc:
 static void __exit sptlrpc_gss_exit(void)
 {
         gss_exit_keyring();
-#ifdef HAVE_GSS_PIPEFS
         gss_exit_pipefs();
-#endif
         cleanup_kerberos_module();
         gss_exit_svc_upcall();
         gss_exit_cli_upcall();