summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2015-06-23 15:40:32 +0530
committerKaushal M <kaushal@redhat.com>2015-06-24 02:59:44 -0700
commit21f2719bf4c43ae6712f41d23de11b5854a019f2 (patch)
tree976bc3948d654932a3287c4736bb9db8e099d82f
parent01e42f25ebdc44847e8b1dce02f7fd486b40dbc2 (diff)
glusterd: use mkdir_p for creating rundir
snapdsvc initialization is now dependent on all subsequent directories and volfile creations as per commit 2b9efc9. However this may not hold true correct for all the cases. While importing a volume we would need to start the service before the store creation. To avoid this dependency, use mkdir_p instead of mkdir to create rundir Change-Id: Ib251043398c40f1b76378e3bc6d0c36c1fe4cca3 BUG: 1234819 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/11364 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c
index 1a68afb56f2..04096a4a116 100644
--- a/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c
@@ -23,7 +23,7 @@ glusterd_svc_create_rundir (char *rundir)
{
int ret = -1;
- ret = mkdir (rundir, 0777);
+ ret = mkdir_p (rundir, 0777, _gf_true);
if ((ret == -1) && (EEXIST != errno)) {
gf_msg (THIS->name, GF_LOG_ERROR, errno,
GD_MSG_CREATE_DIR_FAILED, "Unable to create rundir %s",
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 230e3f8c555..04a181ff874 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -3778,6 +3778,13 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count)
(void) glusterd_delete_stale_volume (old_volinfo, new_volinfo);
}
+ ret = glusterd_snapdsvc_init (new_volinfo);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR, "Failed to initialize "
+ "snapdsvc for volume %s", new_volinfo->volname);
+ goto out;
+ }
+
if (glusterd_is_volume_started (new_volinfo)) {
(void) glusterd_start_bricks (new_volinfo);
if (glusterd_is_snapd_enabled (new_volinfo)) {
@@ -3793,13 +3800,6 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count)
goto out;
}
- ret = glusterd_snapdsvc_init (new_volinfo);
- if (ret) {
- gf_log (this->name, GF_LOG_ERROR, "Failed to initialize "
- "snapdsvc for volume %s", new_volinfo->volname);
- goto out;
- }
-
ret = glusterd_create_volfiles_and_notify_services (new_volinfo);
if (ret)
goto out;