diff --git a/libglusterfs/src/timer.c b/libglusterfs/src/timer.c index 8882aba4c0..b8f05632b1 100644 --- a/libglusterfs/src/timer.c +++ b/libglusterfs/src/timer.c @@ -124,6 +124,7 @@ gf_timer_proc(void *data) gf_timer_t *event = NULL; gf_timer_t *tmp = NULL; xlator_t *old_THIS = NULL; + glusterfs_ctx_t *ctx = NULL; pthread_mutex_lock(®->lock); @@ -148,11 +149,15 @@ gf_timer_proc(void *data) if (event->xl) { old_THIS = THIS; THIS = event->xl; + ctx = event->xl->ctx; + } + if (!ctx || !ctx->cleanup_started) { + event->callbk(event->data); } - event->callbk(event->data); GF_FREE(event); if (old_THIS) { THIS = old_THIS; + ctx = NULL; } pthread_mutex_lock(®->lock);