summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c16
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h7
2 files changed, 18 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index 8bdb9457462..5786694bdf9 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -42,12 +42,19 @@ glusterd_gsync_read_frm_status (char *path, char *buf, size_t blen);
struct gsync_config_opt_vals_ gsync_confopt_vals[] = {
{.op_name = "change_detector",
.no_of_pos_vals = 2,
+ .case_sensitive = _gf_true,
.values = {"xsync", "changelog"},
},
{.op_name = "special_sync_mode",
.no_of_pos_vals = 2,
+ .case_sensitive = _gf_true,
.values = {"partial", "recover"}
},
+ {.op_name = "log-level",
+ .no_of_pos_vals = 5,
+ .case_sensitive = _gf_false,
+ .values = {"critical", "error", "warning", "info", "debug"}
+ },
{.op_name = NULL,
},
};
@@ -894,8 +901,13 @@ gsync_verify_config_options (dict_t *dict, char **op_errstr, char *volname)
if (op_match) {
val_match = _gf_false;
for (i = 0; i < conf_vals->no_of_pos_vals; i++) {
- if (!strcmp (conf_vals->values[i], op_value))
- val_match = _gf_true;
+ if(conf_vals->case_sensitive){
+ if (!strcmp (conf_vals->values[i], op_value))
+ val_match = _gf_true;
+ } else {
+ if (!strcasecmp (conf_vals->values[i], op_value))
+ val_match = _gf_true;
+ }
}
if (!val_match) {
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 26e9b0c0dbf..4ca30770a0f 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -326,9 +326,10 @@ typedef struct glusterd_pending_node_ {
} glusterd_pending_node_t;
struct gsync_config_opt_vals_ {
- char *op_name;
- int no_of_pos_vals;
- char *values[GEO_CONF_MAX_OPT_VALS];
+ char *op_name;
+ int no_of_pos_vals;
+ gf_boolean_t case_sensitive;
+ char *values[GEO_CONF_MAX_OPT_VALS];
};
enum glusterd_op_ret {