libafs: reset global icl set pointers on shutdown
authorMichael Meffie <mmeffie@sinenomine.net>
Tue, 11 Mar 2014 16:40:33 +0000 (12:40 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 26 Mar 2014 20:39:28 +0000 (13:39 -0700)
Avoid panicking when an icl tracing function is called after
shutdown_icl.

There is a window during shutdown in which pioctls can be requested
after the shutdown_icl is issued. Reset the global icl set pointers
so tracing is disabled after the shutdown_icl, instead of using
pointers to freed memory.

Removed the unneeded afs_icl_FindSet calls and use the global
pointers which were set during the initialization.

Reviewed-on: http://gerrit.openafs.org/10884
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 64dd6dd018eb7413636ed6416bd244bb81893d9e)

Change-Id: I65671ee60e3cdf11d9921585dcd67df7cc22c88f
Reviewed-on: http://gerrit.openafs.org/10932
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

src/afs/afs_icl.c

index 63fa1ea..26bf959 100644 (file)
@@ -55,16 +55,14 @@ shutdown_icl(void)
     struct afs_icl_log *logp;
     struct afs_icl_set *setp;
 
-    setp = afs_icl_FindSet("cm");
-    if (setp) {
-       /* Release the reference from Find, and the initial one */
-       afs_icl_SetFree(setp);
+    if (afs_iclSetp) {
+       setp = afs_iclSetp;  /* "cm" */
+       afs_iclSetp = NULL;
        afs_icl_SetFree(setp);
     }
-    setp = afs_icl_FindSet("cmlongterm");
-    if (setp) {
-       /* Release the reference from Find, and the initial one */
-       afs_icl_SetFree(setp);
+    if (afs_iclLongTermSetp) {
+       setp = afs_iclLongTermSetp; /* "cmlongterm" */
+       afs_iclLongTermSetp = NULL;
        afs_icl_SetFree(setp);
     }
     logp = afs_icl_FindLog("cmfx");