summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-08-30 01:44:00 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-08-30 03:23:54 -0700
commit8e4d735b67c78f10fd752f2b48981843595e67b5 (patch)
tree0acb729a868fce8f17ba7d3f4658906c7244622e /glusterfsd
parentbaebaab45980e63f85622e70363fe898cdc572ad (diff)
glusterfsd: call fini of fuse and all active xlators in cleanup_and_exit()
* handles the case of stale mount point in case of killing glusterfs process Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1030 (mount directory is not unmounted after killing glusterfs process) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1030
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 2a542f63c60..0717e313100 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -637,8 +637,9 @@ parse_opts (int key, char *arg, struct argp_state *state)
static void
cleanup_and_exit (int signum)
{
- glusterfs_ctx_t *ctx = NULL;
+ glusterfs_ctx_t *ctx = NULL;
call_pool_t *tmp_pool = NULL;
+ xlator_t *trav = NULL;
ctx = glusterfs_ctx_get ();
@@ -653,6 +654,21 @@ cleanup_and_exit (int signum)
tmp_pool = NULL;
mem_pool_destroy (ctx->stub_mem_pool);
+ /* Call fini() of FUSE xlator first */
+ trav = ctx->master;
+ if (trav && trav->fini)
+ trav->fini (trav);
+
+ /* call fini() of each xlator */
+ trav = NULL;
+ if (ctx->active)
+ trav = ctx->active->top;
+ while (trav) {
+ if (trav->fini)
+ trav->fini (trav);
+ trav = trav->next;
+ }
+
glusterfs_pidfile_cleanup (ctx);
exit (0);