From ac6899c7eaae9983f00645109a569e75f1d0a72a 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 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 Reviewed-on: http://review.gluster.org/13592 Reviewed-on: http://review.gluster.org/13824 Tested-by: soumya k Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Jeff Darcy --- rpc/rpc-lib/src/rpc-clnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rpc/rpc-lib') 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); } -- cgit