summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2010-09-24 08:50:24 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-24 11:11:40 -0700
commit25e868b571bc394dd65b54849f369e1a0c29caab (patch)
tree029479ae8dad62644610287672a97ace8a57dbbf /xlators/mgmt/glusterd/src/glusterd-utils.c
parent6e952607f17dd5ea6e3748f2bbc26234f4b1e553 (diff)
check if the bricks provided are the same and are alredy being used
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1682 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1682
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 411d21765e9..4d21bbe955b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -1737,13 +1737,13 @@ glusterd_is_exisiting_brick (char *hostname, char *path)
GF_ASSERT (this);
priv = this->private;
+
list_for_each_entry (volinfo, &priv->volumes, vol_list) {
list_for_each_entry (tmpbrkinfo, &volinfo->bricks,
brick_list) {
-
- if ((!strcmp(hostname, tmpbrkinfo-> hostname)
- && !strcmp(path, tmpbrkinfo->path))) {
+ if ((!glusterd_is_local_addr (hostname)) && (!glusterd_is_local_addr (tmpbrkinfo->hostname))
+ && !strcmp(path, tmpbrkinfo->path)) {
gf_log ("glusterd", GF_LOG_ERROR, "Brick %s:%s"
" already in use", hostname, path);
ret = 1;