From 2c04db460276c9de666d7ddaffc031492a7de867 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 27 Sep 2012 01:32:45 +0530 Subject: mgmt/glusterd: Prevent extra unref in vol start Problem: Volume start cli handler does dict_unref of the dict unconditionally. It needs to be unrefed only on failure. Fix: Unref the dict only on failure. Tests: Volume start works fine after the fix. Change-Id: I64e5ad3d48f69545dd5e1132672182732b98c466 BUG: 860833 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/4001 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index c6bde925d..8e6b2e926 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -268,11 +268,12 @@ out: glusterd_friend_sm (); glusterd_op_sm (); - if (ret) + if (ret) { ret = glusterd_op_send_cli_response (cli_op, ret, 0, req, dict, "operation failed"); - if (dict) - dict_unref (dict); + if (dict) + dict_unref (dict); + } return ret; } -- cgit