summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2011-08-20 18:26:08 +0530
committerVijay Bellur <vijay@gluster.com>2011-08-20 06:32:04 -0700
commit2ebacdfdd3c39bf2d3139cb7d811356758a2350a (patch)
tree7a5f9630bbc30f5ba409a8d2b17bada5052f79b1 /xlators/mgmt/glusterd
parentfdb7636bd719e560d9d8c0895a3b80bf3973b9d0 (diff)
mgmt/glusterd: Correct generation of nfs options in volfile
Change-Id: If3db4f81215271072030d7119081de5d8b1b3d78 BUG: 3414 Reviewed-on: http://review.gluster.com/279 Reviewed-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 3722bdae7..73650e345 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -2087,7 +2087,7 @@ nfs_option_handler (volgen_graph_t *graph,
return -1;
}
- if (! strcmp (vme->option, "!rpc-auth.addr.%s.reject")) {
+ if (! strcmp (vme->option, "!rpc-auth.addr.*.reject")) {
ret = gf_asprintf (&aa, "rpc-auth.addr.%s.reject",
volinfo->volname);
@@ -2125,7 +2125,7 @@ nfs_option_handler (volgen_graph_t *graph,
return -1;
}
- if (! strcmp (vme->option, "!nfs3.%s.trusted-sync")) {
+ if (! strcmp (vme->option, "!nfs3.*.trusted-sync")) {
ret = gf_asprintf (&aa, "nfs3.%s.trusted-sync",
volinfo->volname);
@@ -2206,6 +2206,13 @@ nfs_option_handler (volgen_graph_t *graph,
return -1;
}
+ if ( (strcmp (vme->voltype, "nfs/server") == 0) &&
+ (vme->option && vme->option[0]!='!') ) {
+ ret = xlator_set_option (xl, vme->option, vme->value);
+ if (ret)
+ return -1;
+ }
+
/*key = strchr (vme->key, '.') + 1;
@@ -2223,18 +2230,6 @@ nfs_option_handler (volgen_graph_t *graph,
return 0;
}
-static int
-nfs_spec_option_handler (volgen_graph_t *graph,
- struct volopt_map_entry *vme, void *param)
-{
- int ret = 0;
-
- ret = nfs_option_handler (graph, vme, param);
- if (!ret)
- return basic_option_handler (graph, vme, NULL);
- return ret;
-}
-
/* builds a graph for nfs server role, with option overrides in mod_dict */
static int
build_nfs_graph (volgen_graph_t *graph, dict_t *mod_dict)
@@ -2323,10 +2318,10 @@ build_nfs_graph (volgen_graph_t *graph, dict_t *mod_dict)
if (mod_dict) {
dict_copy (mod_dict, set_dict);
ret = volgen_graph_set_options_generic (&cgraph, set_dict, voliter,
- nfs_spec_option_handler);
+ basic_option_handler);
} else {
ret = volgen_graph_set_options_generic (&cgraph, voliter->dict, voliter,
- nfs_spec_option_handler);
+ basic_option_handler);
}
ret = volgen_graph_merge_sub (graph, &cgraph);
@@ -2334,7 +2329,24 @@ build_nfs_graph (volgen_graph_t *graph, dict_t *mod_dict)
goto out;
}
+ list_for_each_entry (voliter, &priv->volumes, vol_list) {
+
+ if (mod_dict) {
+ dict_copy (mod_dict, set_dict);
+ ret = volgen_graph_set_options_generic (graph, set_dict, voliter,
+ nfs_option_handler);
+ } else {
+ ret = volgen_graph_set_options_generic (graph, voliter->dict, voliter,
+ nfs_option_handler);
+ }
+
+ if (ret)
+ gf_log ("glusterd", GF_LOG_WARNING, "Could not set "
+ "vol-options for the volume %s", voliter->volname);
+ }
+
out:
+ gf_log ("glusterd", GF_LOG_DEBUG, "Returning %d", ret);
dict_destroy (set_dict);
return ret;