summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRyan Ding <ryan.ding@open-fs.com>2016-08-23 17:42:44 +0800
committerAravinda VK <avishwan@redhat.com>2016-09-02 03:24:41 -0700
commit1f1850ae79a836f1de783c990e575a0d29e26dee (patch)
treeb84336f64cb70953f5c72bfd4946ffa87f005209 /xlators
parentbefae0b48729894282b5b8b174907e24779c3442 (diff)
features/changelog: fix a segment fault in changelog_cleanup_dispatchers
the arg 'count' in changelog_cleanup_dispatchers means the thread count to cleanup, so the cleanup loop should start with count-1, not count. change the invoke place also. Change-Id: Ia00853a2e0c5e01e145f60048b1f0ac05f2440ab BUG: 1369397 Signed-off-by: Ryan Ding <ryan.ding@open-fs.com> Reviewed-on: http://review.gluster.org/15293 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kotresh HR <khiremat@redhat.com> Tested-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Milind Changire <mchangir@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/changelog/src/changelog-rpc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/features/changelog/src/changelog-rpc.c b/xlators/features/changelog/src/changelog-rpc.c
index 4bc24203118..1d10eccf84f 100644
--- a/xlators/features/changelog/src/changelog-rpc.c
+++ b/xlators/features/changelog/src/changelog-rpc.c
@@ -18,7 +18,7 @@ static void
changelog_cleanup_dispatchers (xlator_t *this,
changelog_priv_t *priv, int count)
{
- for (; count >= 0; count--) {
+ for (count--; count >= 0; count--) {
(void) changelog_thread_cleanup
(this, priv->ev_dispatcher[count]);
}
@@ -112,7 +112,7 @@ changelog_init_rpc_threads (xlator_t *this, changelog_priv_t *priv,
ret = pthread_create (&priv->ev_dispatcher[j],
NULL, changelog_ev_dispatch, conn);
if (ret != 0) {
- changelog_cleanup_dispatchers (this, priv, --j);
+ changelog_cleanup_dispatchers (this, priv, j);
break;
}
}