summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorAnoop C S <achiraya@redhat.com>2014-11-12 18:02:15 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-01-06 01:53:56 -0800
commit605db00dbad94d5bba6510e7695383715ef5035a (patch)
tree32a03f865211c0e0faff67004906bcae38201f5c /xlators/mgmt/glusterd/src/glusterd-volgen.c
parentde7205ddddeb56e10d04a000c3e011099c1cbc55 (diff)
rdma: Wrong volfile fetch on fuse mounting tcp,rdma volume via rdma
Backport of http://review.gluster.org/8498 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. Change-Id: Id8b74c1c3e1e7fd323463061f8b13dd623fa6876 BUG: 1166515 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> Reviewed-on: http://review.gluster.org/9182 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index ba653a191ac..f38616ffbc7 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -3975,12 +3975,15 @@ int
generate_client_volfiles (glusterd_volinfo_t *volinfo,
glusterd_client_type_t client_type)
{
+ int i = 0;
+ int ret = -1;
char filepath[PATH_MAX] = {0,};
- int ret = -1;
- char *types[] = {NULL, NULL, NULL};
- int i = 0;
- dict_t *dict = NULL;
- gf_transport_type type = GF_TRANSPORT_TCP;
+ char *types[] = {NULL, NULL, NULL};
+ dict_t *dict = NULL;
+ xlator_t *this = NULL;
+ gf_transport_type type = GF_TRANSPORT_TCP;
+
+ this = THIS;
enumerate_transport_reqs (volinfo->transport_type, types);
dict = dict_new ();
@@ -3998,13 +4001,18 @@ generate_client_volfiles (glusterd_volinfo_t *volinfo,
goto out;
if (client_type == GF_CLIENT_TRUSTED) {
- glusterd_get_trusted_client_filepath (filepath,
- volinfo,
- type);
+ ret = glusterd_get_trusted_client_filepath (filepath,
+ volinfo,
+ type);
} else {
- glusterd_get_client_filepath (filepath,
- volinfo,
- type);
+ ret = glusterd_get_client_filepath (filepath,
+ volinfo,
+ type);
+ }
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Received invalid transport-type");
+ goto out;
}
ret = generate_single_transport_client_volfile (volinfo,