summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/storage/posix/src/posix-helpers.c')
-rw-r--r--xlators/storage/posix/src/posix-helpers.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 0ff94df944e..e9d379fda07 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -2001,6 +2001,12 @@ out:
return NULL;
abort:
+ LOCK (&priv->lock);
+ {
+ priv->health_check_active = _gf_false;
+ }
+ UNLOCK (&priv->lock);
+
/* health-check failed */
gf_msg (this->name, GF_LOG_EMERG, 0, P_MSG_HEALTHCHECK_FAILED,
"health-check failed, going down");
@@ -2041,18 +2047,18 @@ abort:
for (trav_p = &top->children; *trav_p;
trav_p = &(*trav_p)->next) {
victim = (*trav_p)->xlator;
- if (victim &&
- strcmp (victim->name, priv->base_path) == 0) {
+ if (!victim->call_cleanup &&
+ strcmp (victim->name, priv->base_path) == 0) {
victim_found = _gf_true;
break;
}
}
UNLOCK (&ctx->volfile_lock);
- if (victim_found) {
+ if (victim_found && !victim->cleanup_starting) {
gf_log (THIS->name, GF_LOG_INFO, "detaching not-only "
" child %s", priv->base_path);
+ victim->cleanup_starting = 1;
top->notify (top, GF_EVENT_CLEANUP, victim);
- xlator_mem_cleanup (victim);
}
}