From 961bc80c7aeedaa0bdc580f9f08d1c8a2a0992cd Mon Sep 17 00:00:00 2001 From: Venkatesh Somyajulu Date: Sat, 17 Nov 2012 01:36:13 +0530 Subject: 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 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 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 Reviewed-on: http://review.gluster.org/4202 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/storage/posix/src/posix.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'xlators') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 812bfda7d..cf4e08663 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, -- cgit