From 5b82f173ba337b2fe06846c2a0e5f35d1ff53357 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Thu, 8 Jun 2017 13:04:42 +0530 Subject: 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 Change-Id: I2d22a84f9a98b0da261e5fb7850ba1368f3601d7 Reviewed-on: https://review.gluster.org/17492 Tested-by: MOHIT AGRAWAL Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Raghavendra Talur Reviewed-by: Jeff Darcy --- xlators/storage/posix/src/posix-helpers.c | 6 +++--- xlators/storage/posix/src/posix.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'xlators/storage/posix/src') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 52be925aae2..9e4ab5e7d98 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -1864,15 +1864,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 754a45aa6fb..5a11f62dcc7 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -6639,6 +6639,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; } -- cgit