From 6073fc29bf79fad0b0a3ae423d637ded39a00a3a Mon Sep 17 00:00:00 2001 From: krishna Date: Wed, 17 Aug 2011 12:22:49 +0530 Subject: do rpcsvc_init() after we fill nfs_state structure and add to nfsx->options keys for allowing insecure client ports. Change-Id: Iae755d1460f2c7296fc7980b5257afcf778e7767 BUG: 3296 Reviewed-on: http://review.gluster.com/247 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/nfs/server/src/nfs.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index 3527d6ccffb..50c1bc4c2bd 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; -- cgit