summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-rebalance.c
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2015-05-20 18:23:58 +0530
committerKaushal M <kaushal@redhat.com>2015-05-26 06:41:35 -0700
commitf59a1431e38ad644b6bdd4adbdf94ff028c9c60d (patch)
tree2261ef1faa66d2ac6ed044d162df7294d065b085 /xlators/mgmt/glusterd/src/glusterd-rebalance.c
parent30c97ce5c9ba03760bdab7c82208065da631efe9 (diff)
glusterd: fix double-free of rebalance process' rpc object
Change-Id: I0c79c4de47a160b1ecf3a8994eedc02e3f5002a9 BUG: 1223338 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/10872 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rebalance.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index 9111c07b8fc..f126e8f0b1f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -149,10 +149,7 @@ __glusterd_defrag_notify (struct rpc_clnt *rpc, void *mydata,
glusterd_store_perform_node_state_store (volinfo);
- if (defrag->rpc) {
- glusterd_rpc_clnt_unref (priv, defrag->rpc);
- defrag->rpc = NULL;
- }
+ glusterd_defrag_rpc_put (defrag);
if (defrag->cbk_fn)
defrag->cbk_fn (volinfo,
volinfo->rebal.defrag_status);
@@ -339,8 +336,9 @@ glusterd_rebalance_rpc_create (glusterd_volinfo_t *volinfo,
goto out;
//rpc obj for rebalance process already in place.
- if (defrag->rpc) {
+ if (glusterd_defrag_rpc_get (defrag)) {
ret = 0;
+ glusterd_defrag_rpc_put (defrag);
goto out;
}
GLUSTERD_GET_DEFRAG_SOCK_FILE (sockfile, volinfo);