Blob Blame History Raw
From ec1f929585b148b0adac168c0888cdd500fa4b89 Mon Sep 17 00:00:00 2001
From: Gaurav Kumar Garg <garg.gaurav52@gmail.com>
Date: Mon, 29 Feb 2016 15:48:58 +0530
Subject: [PATCH 31/80] glusterd:upon re-peer probe glusterd should not return response to CLI two times

This patch is backport of: http://review.gluster.org/13546

If a node N1 and node N2 is part of the cluster and a node N2 try to reprobe
node N1 when N1 is disconnected by any means (for eg: either server is down
or glusterd is not running or there is a network outage, or firewall is
blocking port number 24007 on which glusterd listen, etc.), then glusterd
trying to send back two responses to CLI resulting into a double free and
a glusterd crash.

With this fix glusterd  will send response to cli only once and prevent
glusterd crash.

Note: glusterd was crashing only when user has done first peer probe with
hostname and re-probe with ip-address or vice-versa.

  >> Change-Id: I92012b147091cf9129f1fbc17834b3f4d7cb46a0
  >> BUG: 1310677
  >> Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
  >> Reviewed-on: http://review.gluster.org/13546
  >> Smoke: Gluster Build System <jenkins@build.gluster.com>
  >> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
  >> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
  >> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>

Change-Id: I2092abf37b21e30e7898e2e86a7614ee1de561aa
BUG: 1314391
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/70828
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Atin Mukherjee <amukherj@redhat.com>
---
 xlators/mgmt/glusterd/src/glusterd-handler.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 085561b..377f4f8 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -3696,6 +3696,7 @@ glusterd_probe_begin (rpcsvc_request_t *req, const char *hoststr, int port,
         } else {
                 glusterd_xfer_cli_probe_resp (req, 0, GF_PROBE_FRIEND, NULL,
                                               (char*)hoststr, port, dict);
+                ret = 0;
         }
 
 out:
-- 
1.7.1