diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index b30c4631806..85e7abba853 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -830,6 +830,10 @@ glusterd_op_stage_start_volume (dict_t *dict, char **op_errstr) if (ret) goto out; + ret = glusterd_validate_volume_id (dict, volinfo); + if (ret) + goto out; + list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { ret = glusterd_resolve_brick (brickinfo); if (ret) { @@ -905,6 +909,10 @@ glusterd_op_stage_stop_volume (dict_t *dict, char **op_errstr) if (ret) goto out; + ret = glusterd_validate_volume_id (dict, volinfo); + if (ret) + goto out; + /* If 'force' flag is given, no check is required */ if (flags & GF_CLI_FLAG_OP_FORCE) goto out; @@ -1003,6 +1011,10 @@ glusterd_op_stage_delete_volume (dict_t *dict, char **op_errstr) if (ret) goto out; + ret = glusterd_validate_volume_id (dict, volinfo); + if (ret) + goto out; + if (glusterd_is_volume_started (volinfo)) { snprintf (msg, sizeof (msg), "Volume %s has been started." "Volume needs to be stopped before deletion.", @@ -1056,6 +1068,10 @@ glusterd_op_stage_heal_volume (dict_t *dict, char **op_errstr) goto out; } + ret = glusterd_validate_volume_id (dict, volinfo); + if (ret) + goto out; + if (!glusterd_is_volume_replicate (volinfo)) { ret = -1; snprintf (msg, sizeof (msg), "Volume %s is not of type " @@ -1142,6 +1158,10 @@ glusterd_op_stage_statedump_volume (dict_t *dict, char **op_errstr) goto out; } + ret = glusterd_validate_volume_id (dict, volinfo); + if (ret) + goto out; + is_running = glusterd_is_volume_started (volinfo); if (!is_running) { snprintf (msg, sizeof(msg), "Volume %s is not in a started" @@ -1209,6 +1229,10 @@ glusterd_op_stage_clearlocks_volume (dict_t *dict, char **op_errstr) goto out; } + ret = glusterd_validate_volume_id (dict, volinfo); + if (ret) + goto out; + if (!glusterd_is_volume_started (volinfo)) { snprintf (msg, sizeof(msg), "Volume %s is not started", volname); |