From 7f9048b753df3e8176ce999d9695e87242b34366 Mon Sep 17 00:00:00 2001
From: Mohit Agrawal <moagrawa@redhat.com>
Date: Thu, 8 Jun 2017 13:04:42 +0530
Subject: [PATCH 495/509] glusterfsd: Deletion of brick dir throw emerg msgs
after stop volume
Problem: Deletion of brick directories throw emerg messages after stop
volume while brick mux is enabled.
Solution: Modify the posix health check monitor thread code to
handled correctly.
> BUG: 1459781
> Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
> Change-Id: I2d22a84f9a98b0da261e5fb7850ba1368f3601d7
> Reviewed-on: https://review.gluster.org/17492
> Tested-by: MOHIT AGRAWAL <moagrawa@redhat.com>
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
> (cherry picked from commit 5b82f173ba337b2fe06846c2a0e5f35d1ff53357)
BUG: 1451602
Change-Id: Iaad3a6a935803f99bf77d6ba6db4b5bb1b187c22
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/108719
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
xlators/features/changetimerecorder/src/changetimerecorder.c | 4 ++--
xlators/storage/posix/src/posix-helpers.c | 6 +++---
xlators/storage/posix/src/posix.c | 1 +
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/xlators/features/changetimerecorder/src/changetimerecorder.c b/xlators/features/changetimerecorder/src/changetimerecorder.c
index ac2406f..6ce68d6 100644
--- a/xlators/features/changetimerecorder/src/changetimerecorder.c
+++ b/xlators/features/changetimerecorder/src/changetimerecorder.c
@@ -2180,9 +2180,9 @@ notify (xlator_t *this, int event, void *data, ...)
CTR_MSG_CLOSE_DB_CONN_FAILED, "Failed closing "
"db connection");
}
- } else {
- ret = default_notify (this, event, data);
}
+ ret = default_notify (this, event, data);
+
out:
return ret;
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 411d0ba..b5961db 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -1876,15 +1876,15 @@ posix_health_check_thread_proc (void *data)
ret = sleep (interval);
if (ret > 0)
break;
-
/* prevent thread errors while doing the health-check(s) */
pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL);
/* Do the health-check.*/
ret = posix_fs_health_check (this);
- if (ret < 0)
+ if (ret < 0 && priv->health_check_active)
goto abort;
-
+ if (!priv->health_check_active)
+ goto out;
pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL);
}
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 7bd0dc5..0524d50 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -6599,6 +6599,7 @@ notify (xlator_t *this,
break;
case GF_EVENT_CLEANUP:
if (priv->health_check) {
+ priv->health_check_active = _gf_false;
pthread_cancel (priv->health_check);
priv->health_check = 0;
}
--
1.8.3.1