diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-07-14 00:20:28 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-07-14 14:44:18 -0700 |
commit | 32451a4dd02bdd95ec800d51267d2e6be43914a4 (patch) | |
tree | 6054625db937658faf1d451d4173a95fd76a8a86 /xlators/mgmt/glusterd/src/glusterd-ha.c | |
parent | 9186c9e84c857a0b1bfbfa4e7b46e9eb741186fb (diff) |
Fixes a crash seen in create volume
Also includes some re-factoring changes.
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1063 (gluster volume create command segfaults)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1063
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-ha.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-ha.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-ha.c b/xlators/mgmt/glusterd/src/glusterd-ha.c index 26de16b3a..398ecce57 100644 --- a/xlators/mgmt/glusterd/src/glusterd-ha.c +++ b/xlators/mgmt/glusterd/src/glusterd-ha.c @@ -52,14 +52,19 @@ int32_t glusterd_ha_create_volume (glusterd_volinfo_t *volinfo) { - char pathname[PATH_MAX] = {0,}; - int32_t ret = -1; - char filepath[PATH_MAX] = {0,}; - char buf[4096] = {0,}; - int fd = -1; + char pathname[PATH_MAX] = {0,}; + int32_t ret = -1; + char filepath[PATH_MAX] = {0,}; + char buf[4096] = {0,}; + int fd = -1; + glusterd_conf_t *priv = NULL; GF_ASSERT (volinfo); - snprintf (pathname, 1024, "%s/vols/%s", GLUSTERD_DEFAULT_WORKDIR, + priv = THIS->private; + + GF_ASSERT (priv); + + snprintf (pathname, 1024, "%s/vols/%s", priv->workdir, volinfo->volname); ret = mkdir (pathname, 0x777); |