summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-12-02 13:29:34 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-12-03 02:00:35 -0800
commit9cc2207e2ffc23e88c23a95bb0783156a85b57c4 (patch)
tree5272a912e0b4a5651b9f46864a67b87308bd6b47 /xlators/storage
parente6c35f74ff4a204cf016ebf201a2630b331f9434 (diff)
storage/posix: Filter out generation number xattr.
Don't return the generation number xattr "trusted.<volname>.gen" in getxattr, since this can cause replicate self-heal to copy it over to another subvolume. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 1219620f1..2bcdd0d0a 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -3110,6 +3110,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
size_t size = 0;
size_t remaining_size = 0;
char key[1024] = {0,};
+ char gen_key[1024] = {0,};
char * value = NULL;
char * list = NULL;
char * real_path = NULL;
@@ -3189,6 +3190,8 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
goto out;
}
+ ret = snprintf (gen_key, 1023, "trusted.%s.gen", this->name);
+
size = sys_llistxattr (real_path, list, size);
remaining_size = size;
@@ -3214,7 +3217,9 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
break;
value [op_ret] = '\0';
- dict_set (dict, key, data_from_dynptr (value, op_ret));
+ if (strcmp (key, gen_key) != 0)
+ dict_set (dict, key, data_from_dynptr (value, op_ret));
+
remaining_size -= strlen (key) + 1;
list_offset += strlen (key) + 1;