From 40e13bc5b44d0b0cdaf7833c848d4a52352e0a13 Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Thu, 8 Aug 2013 15:50:31 +0530 Subject: rpc,glusterd: Use rpc_clnt notifyfn to cleanup mydata rpc: - On a RPC_TRANSPORT_CLEANUP event, rpc_clnt_notify calls the registered notifyfn with a RPC_CLNT_DESTROY event. The notifyfn should properly cleanup the saved mydata on this event. - Break the reconnect chain when an rpc client is disabled. This will prevent new disconnect events which can lead to crashes. glusterd: - Added support for RPC_CLNT_DESTROY in glusterd_brick_rpc_notify - Use a common glusterd_rpc_clnt_unref() function throught glusterd in place of rpc_clnt_unref(). This function correctly gives up the big-lock before performing the unref. Change-Id: I93230441c5089039643fc9f5632477ef1b695348 BUG: 962619 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.org/5512 Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-handler.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 3aafa122b6a..0407741bb7b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -3713,10 +3713,12 @@ __glusterd_brick_rpc_notify (struct rpc_clnt *rpc, void *mydata, "%s:%s", brickinfo->hostname, brickinfo->path); glusterd_set_brick_status (brickinfo, GF_BRICK_STOPPED); - if (rpc_clnt_is_disabled (rpc)) - GF_FREE (brickid); break; + case RPC_CLNT_DESTROY: + GF_FREE (mydata); + mydata = NULL; + break; default: gf_log (this->name, GF_LOG_TRACE, "got some other RPC event %d", event); -- cgit