diff options
author | Kotresh HR <khiremat@redhat.com> | 2016-03-02 11:40:24 +0530 |
---|---|---|
committer | Kaushal M <kaushal@redhat.com> | 2016-03-30 21:36:06 -0700 |
commit | ac6899c7eaae9983f00645109a569e75f1d0a72a (patch) | |
tree | 1cc816483865483c8b5007852af8e5f4fa5b5fa4 | |
parent | de450e8cf8f2bd483523a2721a289d3f1027dacc (diff) |
rpc: Connect back only if rpc is not disabled
This is a backport of the below fix -
http://review.gluster.org/13592
As discussed over http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/14284,
patch #13456 caused a regression where in if there are any pending
rpc invocations, we end up accessing freed object. This patch
fixes it by allowing reconnect during rpc submit only if rpc
is not disabled.
This is to fix regression caused by below patch -
http://review.gluster.org/#/c/13507/
Change-Id: I4ef4dd52bd42368bb89129f98bc973e46c6a39f4
BUG: 1311441
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/13592
Reviewed-on: http://review.gluster.org/13824
Tested-by: soumya k <skoduri@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index 43ebd152c29..cf261fcc58b 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -1591,7 +1591,7 @@ rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, pthread_mutex_lock (&conn->lock); { - if (conn->connected == 0) { + if (conn->connected == 0 && !rpc->disabled) { ret = rpc_transport_connect (conn->trans, conn->config.remote_port); } |