From 9cc2207e2ffc23e88c23a95bb0783156a85b57c4 Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Wed, 2 Dec 2009 13:29:34 +0000 Subject: storage/posix: Filter out generation number xattr. Don't return the generation number xattr "trusted..gen" in getxattr, since this can cause replicate self-heal to copy it over to another subvolume. Signed-off-by: Vikas Gorur Signed-off-by: Anand V. Avati BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315 --- xlators/storage/posix/src/posix.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xlators') 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; -- cgit