diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index b74bbec7c59..db143d5f07a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -1295,6 +1295,24 @@ glusterd_op_stage_bd (dict_t *dict, char **op_errstr) ret = -1; goto out; } + } else if (bd_op == GF_BD_OP_SNAPSHOT_BD) { + ret = dict_get_str (dict, "size", &size); + if (ret) { + snprintf (msg, sizeof(msg), "Failed to get size"); + gf_log ("", GF_LOG_ERROR, "%s", msg); + *op_errstr = gf_strdup (msg); + goto out; + } + + if (gf_string2bytesize (size, &bytes) < 0) { + ret = -1; + snprintf (msg, sizeof(msg), + "Invalid size %s, suffix with KB, MB etc", + size); + gf_log ("", GF_LOG_ERROR, "%s", msg); + *op_errstr = gf_strdup (msg); + goto out; + } } ret = glusterd_volinfo_find (volname, &volinfo); @@ -1324,7 +1342,6 @@ out: gf_log ("", GF_LOG_DEBUG, "Returning %d", ret); return ret; } - #endif int |