diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2012-10-30 12:26:24 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-12-12 00:22:00 -0500 |
commit | 4ccf1d0bafd4655478524398fcf767c177e4e296 (patch) | |
tree | 12db967483b0afe9ab045856276bb2bf58c2be98 | |
parent | 8e657bead9ca85fc88f6c8cd88fd4215c1347f0a (diff) |
glusterd: Made volume reset recognize options in <domain>.<specifier> format
Change-Id: Id057606c2882584310119a1e7dd8674943857841
BUG: 866565
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/178
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/1882
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 79627c637a9..8cc298cb9ad 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -977,6 +977,7 @@ glusterd_options_reset (glusterd_volinfo_t *volinfo, char *key, { int ret = 0; data_t *value = NULL; + char *key_fixed = NULL; gf_log ("", GF_LOG_DEBUG, "Received volume set reset command"); @@ -986,6 +987,15 @@ glusterd_options_reset (glusterd_volinfo_t *volinfo, char *key, if (!strncmp(key, "all", 3)) dict_foreach (volinfo->dict, _delete_reconfig_opt, &is_force); else { + if (glusterd_check_option_exists (key, &key_fixed) != 1) { + gf_log ("glusterd", GF_LOG_ERROR, + "volinfo dict inconsistency: option %s not found", + key); + ret = -1; + goto out; + } + if (key_fixed) + key = key_fixed; value = dict_get (volinfo->dict, key); if (!value) { gf_log ("glusterd", GF_LOG_ERROR, @@ -1017,6 +1027,7 @@ glusterd_options_reset (glusterd_volinfo_t *volinfo, char *key, ret = 0; out: + GF_FREE (key_fixed); gf_log ("", GF_LOG_DEBUG, "Returning %d", ret); return ret; } |