summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 664798ca376..7817e1dd653 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -2511,10 +2511,11 @@ int
glusterd_handle_status_volume (rpcsvc_request_t *req)
{
int32_t ret = -1;
+ uint32_t cmd = 0;
+ dict_t *dict = NULL;
+ char *volname = 0;
gf_cli_req cli_req = {{0,}};
- dict_t *dict = NULL;
- glusterd_op_t cli_op = GD_OP_STATUS_VOLUME;
- char *volname = 0;
+ glusterd_op_t cli_op = GD_OP_STATUS_VOLUME;
GF_ASSERT (req);
@@ -2530,7 +2531,7 @@ glusterd_handle_status_volume (rpcsvc_request_t *req)
if (!dict)
goto out;
ret = dict_unserialize (cli_req.dict.dict_val,
- cli_req.dict.dict_len, &dict);
+ cli_req.dict.dict_len, &dict);
if (ret < 0) {
gf_log (THIS->name, GF_LOG_ERROR, "failed to "
"unserialize buffer");
@@ -2539,15 +2540,22 @@ glusterd_handle_status_volume (rpcsvc_request_t *req)
}
- ret = dict_get_str (dict, "volname", &volname);
- if (ret) {
- gf_log (THIS->name, GF_LOG_ERROR, "failed to get volname");
+ ret = dict_get_uint32 (dict, "cmd", &cmd);
+ if (ret)
goto out;
- }
- gf_log ("glusterd", GF_LOG_INFO, "Received status volume req "
- "for volume %s", volname);
+ if (!(cmd & GF_CLI_STATUS_ALL)) {
+ ret = dict_get_str (dict, "volname", &volname);
+ if (ret) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+ "failed to get volname");
+ goto out;
+ }
+ gf_log (THIS->name, GF_LOG_INFO,
+ "Received status volume req "
+ "for volume %s", volname);
+ }
ret = glusterd_op_begin (req, GD_OP_STATUS_VOLUME, dict);