summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorPrashanth Pai <ppai@redhat.com>2017-08-09 16:34:39 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2017-08-23 13:09:47 +0000
commitee3d9ac7f2db3a4aa9186e08b5a1db62c3270188 (patch)
tree70fce6f1aabcc57d465c427bd292e9936928a259 /xlators/mgmt/glusterd/src/glusterd-utils.c
parentd165ffd7a5e19fa6d0c2f36be9b47280e3df8443 (diff)
glusterd: do not create .glusterfs/indices
glusterd shouldn't concern itself with creating directories specific to certain xlators. The index xlator will now proceed creating './glusterfs/indices' dir only if the parent '.glusterfs' directory exists, which still fixes the original problem reported i.e 'volume start force' command shouldn't create brick path if it doesn't exist (BUG 1457202) This reverts most of the changes done by the commit b58a15948fb3fc37b6c0b70171482f50ed957f42 Change-Id: I7fc52ad64dce220e336c218fb4d85933ca2e61c0 Signed-off-by: Prashanth Pai <ppai@redhat.com> Reviewed-on: https://review.gluster.org/18003 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index dfdd795f186..fbf192ebdb7 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -1444,7 +1444,7 @@ glusterd_validate_and_create_brickpath (glusterd_brickinfo_t *brickinfo,
struct stat root_st = {0,};
char msg[2048] = {0,};
gf_boolean_t is_created = _gf_false;
- char index_basepath[PATH_MAX] = {0};
+ char glusterfs_dir_path[PATH_MAX] = {0};
ret = sys_mkdir (brickinfo->path, 0777);
if (ret) {
@@ -1459,18 +1459,6 @@ glusterd_validate_and_create_brickpath (glusterd_brickinfo_t *brickinfo,
is_created = _gf_true;
}
- glusterd_get_index_basepath (brickinfo, index_basepath,
- sizeof(index_basepath));
-
- ret = mkdir_p (index_basepath, 0600, _gf_true);
- if (ret && (errno != EEXIST)) {
- snprintf (msg, sizeof (msg), "Failed to create index "
- "basepath (%s) for brick %s:%s. Reason : %s ",
- index_basepath, brickinfo->hostname,
- brickinfo->path, strerror (errno));
- goto out;
- }
-
ret = sys_lstat (brickinfo->path, &brick_st);
if (ret) {
snprintf (msg, sizeof (msg), "lstat failed on %s. Reason : %s",
@@ -1547,6 +1535,18 @@ glusterd_validate_and_create_brickpath (glusterd_brickinfo_t *brickinfo,
if (ret)
goto out;
+ /* create .glusterfs directory */
+ snprintf (glusterfs_dir_path, sizeof (glusterfs_dir_path), "%s/%s",
+ brickinfo->path, ".glusterfs");
+ ret = sys_mkdir (glusterfs_dir_path, 0600);
+ if (ret && (errno != EEXIST)) {
+ snprintf (msg, sizeof (msg), "Failed to create .glusterfs "
+ "directory for brick %s:%s. Reason : %s ",
+ brickinfo->hostname, brickinfo->path,
+ strerror (errno));
+ goto out;
+ }
+
ret = 0;
out: