From 325e62cc01a836058622d6ca8e534c352f954848 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Wed, 2 Mar 2016 11:40:24 +0530 Subject: rpc: Connect back only if rpc is not disabled This is to fix regression caused by below patch - http://review.gluster.org/#/c/13456/ 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. Change-Id: I4ef4dd52bd42368bb89129f98bc973e46c6a39f4 BUG: 1295107 Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/13592 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Raghavendra G CentOS-regression: Gluster Build System --- rpc/rpc-lib/src/rpc-clnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rpc') diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index 5513b6db046..2ae3bbad370 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -1558,7 +1558,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); } -- cgit