summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/nfs/server/src/nfs.c')
-rw-r--r--xlators/nfs/server/src/nfs.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index 3527d6ccf..50c1bc4c2 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -497,14 +497,6 @@ nfs_init_state (xlator_t *this)
return NULL;
}
- /* RPC service needs to be started before NFS versions can be
- * inited. */
- nfs->rpcsvc = rpcsvc_init (this, this->ctx, this->options);
- if (!nfs->rpcsvc) {
- gf_log (GF_NFS, GF_LOG_ERROR, "RPC service init failed");
- goto free_nfs;
- }
-
nfs->memfactor = GF_NFS_DEFAULT_MEMFACTOR;
if (dict_get (this->options, "nfs.mem-factor")) {
ret = dict_get_str (this->options, "nfs.mem-factor",
@@ -653,14 +645,14 @@ nfs_init_state (xlator_t *this)
if (nfs->allow_insecure) {
/* blindly set both the options */
- dict_del(this->options, "rpc-auth-allow-insecure");
+ dict_del (this->options, "rpc-auth-allow-insecure");
ret = dict_set_str (this->options,
"rpc-auth-allow-insecure", "on");
if (ret == -1) {
gf_log (GF_NFS, GF_LOG_ERROR, "dict_set_str error");
goto free_foppool;
}
- dict_del(this->options, "rpc-auth.ports.insecure");
+ dict_del (this->options, "rpc-auth.ports.insecure");
ret = dict_set_str (this->options,
"rpc-auth.ports.insecure", "on");
if (ret == -1) {
@@ -668,6 +660,14 @@ nfs_init_state (xlator_t *this)
goto free_foppool;
}
}
+
+ nfs->rpcsvc = rpcsvc_init (this, this->ctx, this->options);
+ if (!nfs->rpcsvc) {
+ ret = -1;
+ gf_log (GF_NFS, GF_LOG_ERROR, "RPC service init failed");
+ goto free_foppool;
+ }
+
this->private = (void *)nfs;
INIT_LIST_HEAD (&nfs->versions);
@@ -680,7 +680,6 @@ free_foppool:
free_rpcsvc:
/*
* rpcsvc_deinit */
-free_nfs:
if (ret < 0) {
GF_FREE (nfs);
nfs = NULL;