summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index c114f0349c7..15c83acbe9c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -3029,6 +3029,7 @@ glusterd_import_new_brick (dict_t *peer_data, int32_t vol_count,
char msg[2048] = {0};
xlator_t *this = NULL;
char *brick_uuid_str = NULL;
+ char abspath[PATH_MAX] = {0};
this = THIS;
GF_ASSERT (this);
@@ -3092,7 +3093,21 @@ glusterd_import_new_brick (dict_t *peer_data, int32_t vol_count,
ret = dict_get_str (peer_data, key, &brick_uuid_str);
if (ret)
goto out;
+
gf_uuid_parse (brick_uuid_str, new_brickinfo->uuid);
+ if (!gf_uuid_compare(new_brickinfo->uuid, MY_UUID)) {
+ if (!realpath (new_brickinfo->path, abspath)) {
+ gf_msg (this->name, GF_LOG_CRITICAL, errno,
+ GD_MSG_BRICKINFO_CREATE_FAIL, "realpath() "
+ "failed for brick %s. The underlying file "
+ "system may be in bad state",
+ new_brickinfo->path);
+ ret = -1;
+ goto out;
+ }
+ strncpy (new_brickinfo->real_path, abspath,
+ strlen(abspath));
+ }
*brickinfo = new_brickinfo;
out: