From e1afe36eb3b006be12e7d7a5b87ff181c6da1250 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 31 Aug 2010 01:17:56 +0000 Subject: fix a crash in cleanup_and_exit () * fini() was being called without proper 'THIS' being set. * in protocol/client, a frame was getting created after frame pool was destroyed Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1030 (mount directory is not unmounted after killing glusterfs process) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1030 --- glusterfsd/src/glusterfsd.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 9b343f5909d..bce5bfd4ca5 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -647,27 +647,31 @@ cleanup_and_exit (int signum) gf_log ("glusterfsd", GF_LOG_NORMAL, "shutting down"); - tmp_pool = ctx->pool; - mem_pool_destroy (tmp_pool->frame_mem_pool); - mem_pool_destroy (tmp_pool->stack_mem_pool); - tmp_pool = NULL; - mem_pool_destroy (ctx->stub_mem_pool); - /* Call fini() of FUSE xlator first */ trav = ctx->master; - if (trav && trav->fini) + if (trav && trav->fini) { + THIS = trav; trav->fini (trav); + } /* call fini() of each xlator */ trav = NULL; if (ctx->active) trav = ctx->active->top; while (trav) { - if (trav->fini) + if (trav->fini) { + THIS = trav; trav->fini (trav); + } trav = trav->next; } + tmp_pool = ctx->pool; + mem_pool_destroy (tmp_pool->frame_mem_pool); + mem_pool_destroy (tmp_pool->stack_mem_pool); + tmp_pool = NULL; + mem_pool_destroy (ctx->stub_mem_pool); + glusterfs_pidfile_cleanup (ctx); exit (0); -- cgit