summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorRajesh Joseph <rjoseph@redhat.com>2014-03-11 16:28:44 +0530
committerRajesh Joseph <rjoseph@redhat.com>2014-03-13 02:52:36 -0700
commit7817de70fedaeffbc320ffb629c1ff6c14f81ecd (patch)
tree54f8b6c7177af9bdcc5114f0cfcdc8ec2e900d81 /xlators/mgmt/glusterd/src/glusterd-utils.c
parent077afd496b2ce24b1d5aebfeb79795b68e357cdd (diff)
snapshot/restore: Restore failed in multiple node test
Failed to set extended attribute on bricks on some nodes. Extended attribute should only be set for local node. Change-Id: Ib5b47b15d2f6f93e146d3d75e9061fccc9570a80 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/7213 Reviewed-by: Sachin Pandit <spandit@redhat.com> Tested-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Tested-by: Avra Sengupta <asengupt@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 90becf346..0c16507d4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -619,21 +619,24 @@ glusterd_snap_volinfo_restore (glusterd_volinfo_t *new_volinfo,
goto out;
}
- /* We need to replace the volume id of all the bricks
- * to the volume id of the origin volume. new_volinfo
- * has the origin volume's volume id*/
- ret = sys_lsetxattr (new_brickinfo->path,
- GF_XATTR_VOL_ID_KEY,
- new_volinfo->volume_id,
- sizeof (new_volinfo->volume_id),
- XATTR_REPLACE);
- if (ret) {
- gf_log (this->name, GF_LOG_ERROR, "Failed to set "
- "extended attribute %s on %s. Reason: "
- "%s, snap: %s", GF_XATTR_VOL_ID_KEY,
- new_brickinfo->path, strerror (errno),
- new_volinfo->volname);
- goto out;
+ if (!uuid_compare (brickinfo->uuid, MY_UUID)) {
+ /* We need to replace the volume id of all the bricks
+ * to the volume id of the origin volume. new_volinfo
+ * has the origin volume's volume id*/
+ ret = sys_lsetxattr (new_brickinfo->path,
+ GF_XATTR_VOL_ID_KEY,
+ new_volinfo->volume_id,
+ sizeof (new_volinfo->volume_id),
+ XATTR_REPLACE);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR, "Failed to "
+ "set extended attribute %s on %s. "
+ "Reason: %s, snap: %s",
+ GF_XATTR_VOL_ID_KEY,
+ new_brickinfo->path, strerror (errno),
+ new_volinfo->volname);
+ goto out;
+ }
}
list_add_tail (&new_brickinfo->brick_list, &new_volinfo->bricks);