From b60653282de2754c715ff07d3c3330c6f1e16643 Mon Sep 17 00:00:00 2001 From: Pranith Kumar Karampuri Date: Tue, 22 Apr 2025 15:27:02 +0530 Subject: [PATCH] Don't fire the callback when cleanup is in progress Fixes: #4525 Change-Id: I8264d21fb285a870adead71015f1fc87a4b375ab Signed-off-by: Pranith Kumar Karampuri --- libglusterfs/src/timer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libglusterfs/src/timer.c b/libglusterfs/src/timer.c index 8882aba4c0b..b8f05632b1d 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);