From 64dd6dd018eb7413636ed6416bd244bb81893d9e Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Tue, 11 Mar 2014 12:40:33 -0400 Subject: [PATCH] libafs: reset global icl set pointers on shutdown 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. Change-Id: I3310868a28850236a2870b8dab858ecb7a815c11 Reviewed-on: http://gerrit.openafs.org/10884 Tested-by: BuildBot Reviewed-by: Marc Dionne Reviewed-by: Benjamin Kaduk Reviewed-by: D Brashear --- src/afs/afs_icl.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/afs/afs_icl.c b/src/afs/afs_icl.c index dd16907ec..558d42a4a 100644 --- a/src/afs/afs_icl.c +++ b/src/afs/afs_icl.c @@ -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"); -- 2.39.5