diff options
author | Anoop C S <achiraya@redhat.com> | 2014-11-12 18:02:15 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2014-11-18 01:00:44 -0800 |
commit | c566e914a1ae84b18e20c917474be3028cd1b5de (patch) | |
tree | f74b3b1efa0bd75cc5db3b5cce51e28dfd9a4df5 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 85e92d160bd71fdaeb3ae89d3440eec8fd438da9 (diff) |
rdma: Wrong volfile fetch on fuse mounting tcp,rdma volume via rdma
As of now for both tcp only volumes and rdma only volumes, volfile
names are in the format <volname>-fuse.vol. This patch will change
the client volfile namings as shown below.
* TCP mounts always use <volname>-fuse.vol
* RDMA mounts always use <volname>.rdma-fuse.vol
Following the above naming convention, for tcp,rdma volumes both
volfiles will be present under /var/lib/glusterd/vols/<volname>/
such that rdma only volume can be mounted as
mount -t glusterfs -o transport=rdma <server/ip>:/<volname> <mount-point>
OR
mount -t glusterfs <server/ip>:/<volname>.rdma <mount-point>
The above command format can also be used to fuse mount a tcp,rdma
volume via rdma transport.
When we try to fuse mount a tcp,rdma volume with transport-type
as rdma it silently mounts via tcp. This change will also make
sure that it fetches the correct volfile based on the
transport-type specified from client side.
BUG: 1131502
Change-Id: I34da4b01ac813b69494a43188f51145457412923
Signed-off-by: Anoop C S <achiraya@redhat.com>
Reviewed-on: http://review.gluster.org/8498
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index ad824be73f3..f5dd952048b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -9053,47 +9053,65 @@ out: return ret; } -void +int glusterd_get_client_filepath (char *filepath, glusterd_volinfo_t *volinfo, gf_transport_type type) { - char path[PATH_MAX] = {0,}; + int ret = 0; + char path[PATH_MAX] = {0,}; glusterd_conf_t *priv = NULL; priv = THIS->private; GLUSTERD_GET_VOLUME_DIR (path, volinfo, priv); - if ((volinfo->transport_type == GF_TRANSPORT_BOTH_TCP_RDMA) && - (type == GF_TRANSPORT_RDMA)) - snprintf (filepath, PATH_MAX, "%s/%s.rdma-fuse.vol", - path, volinfo->volname); - else - snprintf (filepath, PATH_MAX, "%s/%s-fuse.vol", - path, volinfo->volname); + switch (type) { + case GF_TRANSPORT_TCP: + snprintf (filepath, PATH_MAX, + "%s/%s-fuse.vol", path, volinfo->volname); + break; + + case GF_TRANSPORT_RDMA: + snprintf (filepath, PATH_MAX, + "%s/%s.rdma-fuse.vol", path, volinfo->volname); + break; + default: + ret = -1; + break; + } + + return ret; } -void +int glusterd_get_trusted_client_filepath (char *filepath, glusterd_volinfo_t *volinfo, gf_transport_type type) { - char path[PATH_MAX] = {0,}; + int ret = 0; + char path[PATH_MAX] = {0,}; glusterd_conf_t *priv = NULL; priv = THIS->private; GLUSTERD_GET_VOLUME_DIR (path, volinfo, priv); - if ((volinfo->transport_type == GF_TRANSPORT_BOTH_TCP_RDMA) && - (type == GF_TRANSPORT_RDMA)) - snprintf (filepath, PATH_MAX, - "%s/trusted-%s.rdma-fuse.vol", + switch (type) { + case GF_TRANSPORT_TCP: + snprintf (filepath, PATH_MAX, "%s/trusted-%s-fuse.vol", path, volinfo->volname); - else - snprintf (filepath, PATH_MAX, - "%s/trusted-%s-fuse.vol", + break; + + case GF_TRANSPORT_RDMA: + snprintf (filepath, PATH_MAX, "%s/trusted-%s.rdma-fuse.vol", path, volinfo->volname); + break; + default: + ret = -1; + break; + } + + return ret; } int |