diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2012-09-27 01:32:45 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-09-26 13:43:05 -0700 |
commit | 2c04db460276c9de666d7ddaffc031492a7de867 (patch) | |
tree | fc84e6863d784c8317e289e3d8dd200f8dbcddd4 | |
parent | bc2b5977a52baff96ffd69b118967a82d5933555 (diff) |
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 <pranithk@gluster.com>
Reviewed-on: http://review.gluster.org/4001
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index c6bde925de2..8e6b2e9269d 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; } |