summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-06-08 09:18:43 +0000
committerAnand Avati <avati@gluster.com>2011-06-08 11:19:17 -0700
commitc9f61338fadc69ad1da6f8100fe0c37057d622a0 (patch)
tree040f6020253ca76aecaad3f8bb7fd22a419823b2 /xlators/protocol
parent84eca97a940fc1cad339e9238528c29cfcf9ac42 (diff)
fix multiple transport related portmap issues in client handshake
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2294 (Currently there is no way through cli to make a volume listen on both the transports (socket/rdma)) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2294
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client-handshake.c21
-rw-r--r--xlators/protocol/client/src/client.h3
2 files changed, 24 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
index 5af149d568a..583fb948378 100644
--- a/xlators/protocol/client/src/client-handshake.c
+++ b/xlators/protocol/client/src/client-handshake.c
@@ -918,6 +918,8 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m
conf->connecting = 0;
conf->connected = 1;
+ conf->need_different_port = 0;
+
/* TODO: more to test */
client_post_handshake (frame, frame->this);
@@ -1193,6 +1195,8 @@ client_query_portmap (xlator_t *this, struct rpc_clnt *rpc)
clnt_conf_t *conf = NULL;
dict_t *options = NULL;
char *remote_subvol = NULL;
+ char *xprt = NULL;
+ char brick_name[PATH_MAX] = {0,};
options = this->options;
conf = this->private;
@@ -1206,6 +1210,23 @@ client_query_portmap (xlator_t *this, struct rpc_clnt *rpc)
req.brick = remote_subvol;
+ /* FIXME: Dirty work around */
+ if (!dict_get_str (options, "transport-type", &xprt)) {
+ /* This logic is required only in case of 'rdma' client
+ transport-type and the volume is of 'tcp,rdma'
+ transport type. */
+ if (!strcmp (xprt, "rdma")) {
+ if (!conf->need_different_port) {
+ snprintf (brick_name, PATH_MAX, "%s.rdma",
+ remote_subvol);
+ req.brick = brick_name;
+ conf->need_different_port = 1;
+ } else {
+ conf->need_different_port = 0;
+ }
+ }
+ }
+
fr = create_frame (this, this->ctx->pool);
if (!fr) {
ret = -1;
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
index 40a3d5d3d37..96080ef6108 100644
--- a/xlators/protocol/client/src/client.h
+++ b/xlators/protocol/client/src/client.h
@@ -66,6 +66,9 @@ typedef struct clnt_conf {
which was sent earlier */
char portmap_err_logged; /* flag used to prevent
excessive logging */
+ char need_different_port; /* flag used to change the
+ portmap path in case of
+ 'tcp,rdma' on server */
} clnt_conf_t;
typedef struct _client_fd_ctx {