summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2020-01-10 08:24:35 +0200
committerAmar Tumballi <amarts@gmail.com>2020-01-13 07:01:16 +0000
commit9189ed3201f1da89f16595d685b67a71e075d5be (patch)
tree9e5131471e734a21299f7bf5d65de288d2c4a7a4 /xlators/mgmt/glusterd/src/glusterd-volgen.c
parent33c3cbe71b67f523538b04334f1ef962953281ed (diff)
glusterd-volgen.c: fix to disable property when gNFS disabled.
The code was not ifdef'ed properly when gNFS was not enabled. Strangely, I could not reproduce the failure on my system (Fedora 31), but it was reproduced elsehwere and the fix was verified to correct it. The failure: gluster volume create testvol replica 3 127.0.0.2:/tests/brick{1..3} force gluster v set testvol write-behind off grep -rne write-behind /var/lib/glusterd/vols/testvol/trusted-testvol.tcp-fuse.vol The last grep was supposed to come out empty. The issue was that perfxl_option_handler may not have been called when it should have been. Change-Id: Ie9f8ec87dabeef6624527c2266ddf9af01ca7373 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 45f6d7a..d9e5e86 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -2758,6 +2758,7 @@ gfproxy_client_perfxl_option_handler(volgen_graph_t *graph,
return 0;
}
+#ifdef BUILD_GNFS
static int
nfsperfxl_option_handler(volgen_graph_t *graph, struct volopt_map_entry *vme,
void *param)
@@ -2780,6 +2781,7 @@ nfsperfxl_option_handler(volgen_graph_t *graph, struct volopt_map_entry *vme,
else
return -1;
}
+#endif
#if (HAVE_LIB_XML)
int
@@ -3880,7 +3882,6 @@ static int
client_graph_set_perf_options(volgen_graph_t *graph,
glusterd_volinfo_t *volinfo, dict_t *set_dict)
{
- char *volname = NULL;
int ret = 0;
/*
@@ -3909,18 +3910,19 @@ client_graph_set_perf_options(volgen_graph_t *graph,
if (ret < 0)
return ret;
- volname = volinfo->volname;
-
#ifdef BUILD_GNFS
data_t *tmp_data = NULL;
+ char *volname = NULL;
+
tmp_data = dict_get_sizen(set_dict, "nfs-volume-file");
- if (!tmp_data)
- return volgen_graph_set_options_generic(graph, set_dict, volinfo,
- &perfxl_option_handler);
- else
-#endif
+ if (tmp_data) {
+ volname = volinfo->volname;
return volgen_graph_set_options_generic(graph, set_dict, volname,
&nfsperfxl_option_handler);
+ } else
+#endif
+ return volgen_graph_set_options_generic(graph, set_dict, volinfo,
+ &perfxl_option_handler);
}
static int