From 017721e5cad5b8a5b498a06e54098ea920d5bc96 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Thu, 3 Jan 2019 17:44:18 +0530 Subject: afr/shd: Cleanup self heal daemon resources during afr fini We were not properly cleaning self-heal daemon resources during afr fini. This patch will clean the same. Change-Id: I597860be6f781b195449e695d871b8667a418d5a updates: bz#1659708 Signed-off-by: Mohammed Rafi KC --- libglusterfs/src/syncop-utils.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/syncop-utils.c b/libglusterfs/src/syncop-utils.c index be03527496e..b842142a0b3 100644 --- a/libglusterfs/src/syncop-utils.c +++ b/libglusterfs/src/syncop-utils.c @@ -350,6 +350,11 @@ syncop_mt_dir_scan(call_frame_t *frame, xlator_t *subvol, loc_t *loc, int pid, gf_boolean_t cond_init = _gf_false; gf_boolean_t mut_init = _gf_false; gf_dirent_t entries; + xlator_t *this = NULL; + + if (frame) { + this = frame->this; + } /*For this functionality to be implemented in general, we need * synccond_t infra which doesn't block the executing thread. Until then @@ -397,6 +402,9 @@ syncop_mt_dir_scan(call_frame_t *frame, xlator_t *subvol, loc_t *loc, int pid, list_for_each_entry_safe(entry, tmp, &entries.list, list) { + if (this && this->cleanup_starting) + goto out; + list_del_init(&entry->list); if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) { gf_dirent_entry_free(entry); -- cgit