From 4ccf1d0bafd4655478524398fcf767c177e4e296 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Tue, 30 Oct 2012 12:26:24 +0530 Subject: glusterd: Made volume reset recognize options in . format Change-Id: Id057606c2882584310119a1e7dd8674943857841 BUG: 866565 Signed-off-by: Krutika Dhananjay Reviewed-on: https://code.engineering.redhat.com/gerrit/178 Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur Reviewed-on: https://code.engineering.redhat.com/gerrit/1882 --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; } -- cgit