From 7e085ebc9ca0d34e6251611fdc42dadc243ce276 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Thu, 17 Nov 2011 14:17:46 +0530 Subject: glusterd: Fixed volume profile's "are all bricks down?" algo. "count" key is not set if no brick in the volume (located across peers) is running. Sending "count" even when zero bricks are running from originator glusterd to client, simplifies "are all bricks down?" algo. Change-Id: I2b1da13ed4b1b9276917908223c9b2c45ca024b3 BUG: 3553 Reviewed-on: http://review.gluster.com/642 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c index 853fd931d22..22d1bffcfae 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c @@ -58,6 +58,7 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, char *errstr = NULL; int32_t status = 0; int32_t is_ctx_dict = 0; + int32_t count = 0; GF_ASSERT (THIS); @@ -118,6 +119,14 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, case GD_OP_SET_VOLUME: case GD_OP_PROFILE_VOLUME: { + if (dict_get_int32 (ctx, "count", &count)) { + ret = dict_set_int32 (ctx, "count", 0); + if (ret) { + gf_log (THIS->name, GF_LOG_ERROR, + "Failed to set brick count"); + break; + } + } is_ctx_dict = 1; } case GD_OP_CREATE_VOLUME: -- cgit