diff options
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 4 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 1 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 29 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 3 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-set.c | 1 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.h | 2 | ||||
-rw-r--r-- | xlators/nfs/server/src/nfs.c | 13 |
7 files changed, 28 insertions, 25 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index b2ff8c2e00e..1f31d196af2 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -2673,10 +2673,6 @@ glusterd_store_update_volinfo (glusterd_volinfo_t *volinfo) } else if (!strncmp (key, GLUSTERD_STORE_KEY_VOL_TRANSPORT, strlen (GLUSTERD_STORE_KEY_VOL_TRANSPORT))) { volinfo->transport_type = atoi (value); - volinfo->nfs_transport_type = volinfo->transport_type; - if (volinfo->transport_type == GF_TRANSPORT_BOTH_TCP_RDMA) { - volinfo->nfs_transport_type = GF_DEFAULT_NFS_TRANSPORT; - } } else if (!strncmp (key, GLUSTERD_STORE_KEY_VOL_ID, strlen (GLUSTERD_STORE_KEY_VOL_ID))) { ret = uuid_parse (value, volinfo->volume_id); diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index f5dd952048b..85d716e2e18 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -568,7 +568,6 @@ glusterd_volinfo_dup (glusterd_volinfo_t *volinfo, new_volinfo->dist_leaf_count = volinfo->dist_leaf_count; new_volinfo->sub_count = volinfo->sub_count; new_volinfo->transport_type = volinfo->transport_type; - new_volinfo->nfs_transport_type = volinfo->nfs_transport_type; new_volinfo->brick_count = volinfo->brick_count; dict_copy (volinfo->dict, new_volinfo->dict); diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index ea255f93208..247f369274f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -1160,15 +1160,20 @@ get_vol_transport_type (glusterd_volinfo_t *volinfo, char *tt) transport_type_to_str (volinfo->transport_type, tt); } +/* If no value has specfied for tcp,rdma volume from cli + * use tcp as default value.Otherwise, use transport type + * mentioned in volinfo + */ static void get_vol_nfs_transport_type (glusterd_volinfo_t *volinfo, char *tt) { - if (volinfo->nfs_transport_type == GF_TRANSPORT_BOTH_TCP_RDMA) { - gf_log ("", GF_LOG_ERROR, "%s:nfs transport cannot be both" - " tcp and rdma", volinfo->volname); - GF_ASSERT (0); - } - transport_type_to_str (volinfo->nfs_transport_type, tt); + if (volinfo->transport_type == GF_TRANSPORT_BOTH_TCP_RDMA) { + strcpy (tt, "tcp"); + gf_log ("glusterd", GF_LOG_INFO, + "The default transport type for tcp,rdma volume " + "is tcp if option is not defined by the user "); + } else + transport_type_to_str (volinfo->transport_type, tt); } /* gets the volinfo, dict, a character array for filling in @@ -3425,8 +3430,16 @@ build_nfs_graph (volgen_graph_t *graph, dict_t *mod_dict) if (ret) goto out; - /* If both RDMA and TCP are the transport_type, use RDMA - for NFS client protocols */ + /* If both RDMA and TCP are the transport_type, use TCP for NFS + * client protocols, because tcp,rdma volume can be created in + * servers which does not have rdma supported hardware + * The transport type specified here is client transport type + * which is used for communication between gluster-nfs and brick + * processes. + * User can specify client transport for tcp,rdma volume using + * nfs.transport-type, if it is not set by user default + * one will be tcp. + */ memset (&cgraph, 0, sizeof (cgraph)); if (mod_dict) get_transport_type (voliter, mod_dict, nfs_xprt, _gf_true); diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index dd3308c40d2..10a6920ff32 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -2004,13 +2004,10 @@ glusterd_op_create_volume (dict_t *dict, char **op_errstr) if (strcasecmp (trans_type, "rdma") == 0) { volinfo->transport_type = GF_TRANSPORT_RDMA; - volinfo->nfs_transport_type = GF_TRANSPORT_RDMA; } else if (strcasecmp (trans_type, "tcp") == 0) { volinfo->transport_type = GF_TRANSPORT_TCP; - volinfo->nfs_transport_type = GF_TRANSPORT_TCP; } else { volinfo->transport_type = GF_TRANSPORT_BOTH_TCP_RDMA; - volinfo->nfs_transport_type = GF_DEFAULT_NFS_TRANSPORT; } if (bricks) { diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 36222b9cf75..27e0028e13a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -1432,7 +1432,6 @@ struct volopt_map_entry glusterd_volopt_map[] = { { .key = "nfs.transport-type", .voltype = "nfs/server", .option = "!nfs.transport-type", - .value = "tcp", .op_version = 1, .description = "Specifies the nfs transport type. Valid " "transport types are 'tcp' and 'rdma'." diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h index 64fe63933a5..208e5fc918c 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -247,7 +247,6 @@ typedef enum gf_transport_type_ { GF_TRANSPORT_BOTH_TCP_RDMA, } gf_transport_type; -#define GF_DEFAULT_NFS_TRANSPORT GF_TRANSPORT_RDMA typedef enum gf_rb_status_ { GF_RB_STATUS_NONE, @@ -360,7 +359,6 @@ struct glusterd_volinfo_ { uint32_t cksum; uint32_t quota_conf_cksum; gf_transport_type transport_type; - gf_transport_type nfs_transport_type; dict_t *dict; diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index 31de64cd21d..503f6534ab1 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -846,12 +846,13 @@ nfs_init_state (xlator_t *this) } } - if (dict_get(this->options, "transport-type") == NULL) { - ret = dict_set_str (this->options, "transport-type", "socket"); - if (ret == -1) { - gf_log (GF_NFS, GF_LOG_ERROR, "dict_set_str error"); - goto free_foppool; - } + /* Right only socket support exists between nfs client and + * gluster nfs, so we can set default value as socket + */ + ret = dict_set_str (this->options, "transport-type", "socket"); + if (ret == -1) { + gf_log (GF_NFS, GF_LOG_ERROR, "dict_set_str error"); + goto free_foppool; } nfs->mount_udp = 0; |