[Bugs] [Bug 1716812] Failed to create volume which transport_type is "tcp, rdma"
bugzilla at redhat.com
bugzilla at redhat.com
Tue Jun 4 07:58:44 UTC 2019
https://bugzilla.redhat.com/show_bug.cgi?id=1716812
--- Comment #1 from guolei <guol-fnst at cn.fujitsu.com> ---
Test is ok on glusterfs3.12.9 ,failed on glusterfs3.13.2 and later version.
generate_client_volfiles (glusterd_volinfo_t *volinfo,
glusterd_client_type_t client_type)
{
int i = 0;
int ret = -1;
char filepath[PATH_MAX] = {0,};
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 ();
if (!dict)
goto out;
for (i = 0; types[i]; i++) {
memset (filepath, 0, sizeof (filepath));
ret = dict_set_str (dict, "client-transport-type", types[i]);
if (ret)
goto out;
type = transport_str_to_type (types[i]);
ret = dict_set_uint32 (dict, "trusted-client", client_type);
if (ret)
goto out;
if (client_type == GF_CLIENT_TRUSTED) {
ret = glusterd_get_trusted_client_filepath (filepath,
volinfo,
type);
} else if (client_type == GF_CLIENT_TRUSTED_PROXY) {
glusterd_get_gfproxy_client_volfile (volinfo,
filepath,
PATH_MAX);
<---------------------------- Maybe this is the problem? transport type should
be passed to glusterd_get_gfproxy_client_volfile .Or filepath is NULL.
ret = dict_set_str (dict, "gfproxy-client", "on");
} else {
ret = glusterd_get_client_filepath (filepath,
volinfo,
type);
}
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, EINVAL,
GD_MSG_INVALID_ENTRY,
"Received invalid transport-type");
goto out;
}
* ret = generate_single_transport_client_volfile (volinfo,
filepath,
dict);*
if (ret)
goto out;
}
/* Generate volfile for rebalance process */
glusterd_get_rebalance_volfile (volinfo, filepath, PATH_MAX);
ret = build_rebalance_volfile (volinfo, filepath, dict);
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, 0,
GD_MSG_VOLFILE_CREATE_FAIL,
"Failed to create rebalance volfile for %s",
volinfo->volname);
goto out;
}
out:
if (dict)
dict_unref (dict);
gf_msg_trace ("glusterd", 0, "Returning %d", ret);
return ret;
}
void
glusterd_get_gfproxy_client_volfile (glusterd_volinfo_t *volinfo,
char *path, int path_len)
{
char workdir[PATH_MAX] = {0, };
glusterd_conf_t *priv = THIS->private;
GLUSTERD_GET_VOLUME_DIR (workdir, volinfo, priv);
switch (volinfo->transport_type) {
case GF_TRANSPORT_TCP:
snprintf (path, path_len,
"%s/trusted-%s.tcp-gfproxy-fuse.vol",
workdir, volinfo->volname);
break;
case GF_TRANSPORT_RDMA:
snprintf (path, path_len,
"%s/trusted-%s.rdma-gfproxy-fuse.vol",
workdir, volinfo->volname);
break;
default:
break;
}
}
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
More information about the Bugs
mailing list