summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawa@redhat.com>2018-05-23 09:06:04 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-05-25 02:05:37 +0000
commit7b95d5a4b3988757bf8c91f82dcaf86ed3da6875 (patch)
tree899253a1bcbc3f10988cbe038f47cce61823bcea /xlators/storage
parent57dd3692d1a10d446db7fe919497335984e2cd3f (diff)
Revert "gluster: Sometimes Brick process is crashed at the time of stopping brick"
Updates: bz#1582286 This reverts commit 0043c63f70776444f69667a4ef9596217ecb42b7. Change-Id: Iab3b4f4a54e122c589e515add93c6effc966b3e0
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix-common.c6
-rw-r--r--xlators/storage/posix/src/posix-helpers.c14
2 files changed, 6 insertions, 14 deletions
diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c
index c17534536d2..64ab34c15c0 100644
--- a/xlators/storage/posix/src/posix-common.c
+++ b/xlators/storage/posix/src/posix-common.c
@@ -1110,13 +1110,12 @@ posix_fini (xlator_t *this)
struct posix_private *priv = this->private;
if (!priv)
return;
- LOCK (&priv->lock);
- if (priv->health_check_active) {
+ this->private = NULL;
+ if (priv->health_check) {
priv->health_check_active = _gf_false;
pthread_cancel (priv->health_check);
priv->health_check = 0;
}
- UNLOCK (&priv->lock);
if (priv->disk_space_check) {
priv->disk_space_check_active = _gf_false;
pthread_cancel (priv->disk_space_check);
@@ -1141,7 +1140,6 @@ posix_fini (xlator_t *this)
GF_FREE (priv->hostname);
GF_FREE (priv->trash_path);
GF_FREE (priv);
- this->private = NULL;
return;
}
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 00118b2d123..022f8b21571 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -2124,12 +2124,6 @@ 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");
@@ -2170,18 +2164,18 @@ abort:
for (trav_p = &top->children; *trav_p;
trav_p = &(*trav_p)->next) {
victim = (*trav_p)->xlator;
- if (!victim->call_cleanup &&
- strcmp (victim->name, priv->base_path) == 0) {
+ if (victim &&
+ strcmp (victim->name, priv->base_path) == 0) {
victim_found = _gf_true;
break;
}
}
UNLOCK (&ctx->volfile_lock);
- if (victim_found && !victim->cleanup_starting) {
+ if (victim_found) {
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);
}
}