summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src
diff options
context:
space:
mode:
authorVenkatesh Somyajulu <vsomyaju@redhat.com>2012-11-17 01:36:13 +0530
committerVijay Bellur <vbellur@redhat.com>2012-11-20 00:45:59 -0800
commit961bc80c7aeedaa0bdc580f9f08d1c8a2a0992cd (patch)
tree7fe6f4037fce018ea7a455b0c8a021808abedab1 /xlators/storage/posix/src
parent65cc8cb531456de934e8ba3175430e8fcb304ca5 (diff)
posix: Fix volume will not start if brick has no volume-id attribute
Problem: If the extended attribute (trusted.glusterfs.volume-id) of a brick is absent and <gluster volume start volume-name> command is executed then curretly volume-id from the volume file will be set as an extended attribute of the brick and volume will get started. But if setup is such that brick is used as a mount point and before executing the <gluster volume start volume-name> command, nothing is mounted on the brick then all the file operations will take place at the brick but actual intention of the brick is to be used as mount point only. FIX: Do not start the volume if extended attribute (trusted.glusterfs.volume-id) is set absent. Change-Id: Id2462d87d6087e97e0b8831512fdbc3595f7078b BUG: 860297 Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com> Reviewed-on: http://review.gluster.org/4202 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src')
-rw-r--r--xlators/storage/posix/src/posix.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 812bfda7dfb..cf4e086633b 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -4158,16 +4158,13 @@ init (xlator_t *this)
goto out;
}
} else if ((size == -1) && (errno == ENODATA)) {
- /* Using the export for first time */
- size = sys_lsetxattr (dir_data->data,
- "trusted.glusterfs.volume-id",
- dict_uuid, 16, 0);
- if (size == -1) {
+
gf_log (this->name, GF_LOG_ERROR,
- "failed to set volume id on export");
+ "Extended attribute trusted.glusterfs."
+ "volume-id is absent");
ret = -1;
goto out;
- }
+
} else if ((size == -1) && (errno != ENODATA)) {
/* Wrong 'volume-id' is set, it should be error */
gf_log (this->name, GF_LOG_WARNING,