summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-08-26 05:53:41 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-26 07:31:13 -0700
commit9fe52c92ace1c8c1e6e016aad8bb14973d6c9dc0 (patch)
tree4934eac56bfe5aa6e4f098093b98fdd30d13b285
parent44f187fad77512e6b9d22852b79dc9621d688798 (diff)
glusterd: handle failure of 'getspec' in case of '-' in volume name
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1433 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1433
-rw-r--r--extras/volgen/CreateVolfile.py2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handshake.c5
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c4
3 files changed, 4 insertions, 7 deletions
diff --git a/extras/volgen/CreateVolfile.py b/extras/volgen/CreateVolfile.py
index 22cffcffe..c8143a03a 100644
--- a/extras/volgen/CreateVolfile.py
+++ b/extras/volgen/CreateVolfile.py
@@ -348,7 +348,7 @@ class CreateVolfile:
i = 0
for export in self.host_dict[self.host]:
export_volfile = "%s/%s-%d.vol" % (self.conf_dir,
- str(self.host + '-' + self.volume_name),
+ str(self.volume_name + '.' + self.host),
i)
i += 1
exp_fd = file ("%s" % (export_volfile),"w")
diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c
index 43a937317..471fed3f1 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handshake.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c
@@ -56,10 +56,7 @@ build_volfile_path (const char *volname, char *path,
ret = glusterd_volinfo_find (dup_volname, &volinfo);
if (ret) {
/* Split the volume name */
- vol = strtok_r (dup_volname, "-", &tmp);
- if (!vol)
- goto out;
- vol = strtok_r (NULL, "-", &tmp);
+ vol = strtok_r (dup_volname, ".", &tmp);
if (!vol)
goto out;
ret = glusterd_volinfo_find (vol, &volinfo);
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 2132c56ff..e8d9b4634 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -762,8 +762,8 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
port = pmap_registry_alloc (THIS);
GLUSTERD_GET_BRICK_PIDFILE (pidfile, path, brickinfo->hostname, count);
- snprintf (volfile, PATH_MAX, "%s-%s-%d", brickinfo->hostname,
- volinfo->volname, count);
+ snprintf (volfile, PATH_MAX, "%s.%s-%d", volinfo->volname,
+ brickinfo->hostname, count);
snprintf (cmd_str, 8192,
"%s/sbin/glusterfs --xlator-option server-*.listen-port=%d "