path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
authorAvra Sengupta <>2015-07-05 12:21:31 +0530
committerRajesh Joseph <>2015-07-06 22:55:48 -0700
commit0efffcdb4eccac48d9eac26d7715ce24493ed753 (patch)
tree4a30eb9564090e2114df5d29605f4f0494c1c6a8 /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parent1fceab7e54b4a7f18181ed6bbbdea065d402bff1 (diff)
glusterd/shared_storage: Use /var/lib/glusterd/ss_brick as shared storage's brick
Backport of The brick path we use to create shared storage is /var/run/gluster/ss_brick. The problem with using this brick path is /var/run/gluster is a tmpfs and all the brick/shared storage data will be wiped off when the node restarts. Hence using /var/lib/glusterd/ss_brick as the brick path for shared storage volume as this brick and the shared storage volume is internally created by us (albeit on user's request), and contains only internal state data and no user data. Change-Id: I808d1aa3e204a5d2022086d23bdbfdd44a2cfb1c BUG: 1230399 Signed-off-by: Avra Sengupta <> Reviewed-on: Tested-by: Gluster Build System <> Reviewed-by: Rajesh Joseph <>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
1 files changed, 4 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 859019e0d5f..9076aa8b5f6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -55,7 +55,6 @@
#include <signal.h>
#include <sys/wait.h>
-extern char ss_brick_path[PATH_MAX];
extern char local_node_hostname[PATH_MAX];
static int
glusterd_set_shared_storage (dict_t *dict, char *key, char *value,
@@ -2295,12 +2294,12 @@ glusterd_set_shared_storage (dict_t *dict, char *key, char *value,
/* Re-create the brick path so as to be *
* able to re-use it *
- ret = recursive_rmdir (ss_brick_path);
+ ret = recursive_rmdir (GLUSTER_SHARED_STORAGE_BRICK_DIR);
if (ret) {
snprintf (errstr, PATH_MAX,
"Failed to remove shared "
"storage brick(%s). "
- "Reason: %s", ss_brick_path,
strerror (errno));
gf_msg (this->name, GF_LOG_ERROR, errno,
GD_MSG_DIR_OP_FAILED, "%s", errstr);
@@ -2308,12 +2307,12 @@ glusterd_set_shared_storage (dict_t *dict, char *key, char *value,
goto out;
- ret = mkdir_p (ss_brick_path, 0777, _gf_true);
+ ret = mkdir_p (GLUSTER_SHARED_STORAGE_BRICK_DIR, 0777, _gf_true);
if (-1 == ret) {
snprintf (errstr, PATH_MAX,
"Failed to create shared "
"storage brick(%s). "
- "Reason: %s", ss_brick_path,
strerror (errno));
gf_msg (this->name, GF_LOG_ERROR, errno,
GD_MSG_CREATE_DIR_FAILED, "%s", errstr);