From 5afc6aba906a21aee19c2f1baaa7d9eb762ae0ac Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Fri, 23 Sep 2016 10:47:03 +0530 Subject: afr: Ignore gluster internal (virtual) xattrs in metadata heal check Problem: In arbiter configuration, posix-xlator in the arbiter brick always sets the GF_CONTENT_KEY in the response dict with a value 0. If the file size on the data bricks is more than quick-read's max-file-size (64kb default), those bricks don't set the key. Because of this difference in the no. of dict elements, afr triggers metadata heal in lookup code path, in turn leading to extra lookups+inodelks. Fix: Changed afr dict comparison logic to ignore all virtual xattrs and the on-disk ones that we should not be healing. Also removed is_virtual_xattr() function. The original callers to this function (upcall) don't seem to need it anymore. Change-Id: I05730bdd39d8fb0b9a49a5fc9c0bb01f0d3bb308 BUG: 1378684 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/15548 NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/storage/posix/src/posix-helpers.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'xlators/storage/posix/src/posix-helpers.c') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 6162f2649e1..becbd94c226 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -117,22 +117,6 @@ posix_xattr_ignorable (char *key) return _is_in_array (posix_ignore_xattrs, key); } -static gf_boolean_t -posix_is_valid_namespace (char *key) -{ - static char *xattr_namespaces[] = {"trusted.", "security.", "system.", - "user.", NULL }; - int i = 0; - - for (i = 0; xattr_namespaces[i]; i++) { - if (strncmp (key, xattr_namespaces[i], - strlen (xattr_namespaces[i])) == 0) - return _gf_true; - } - - return _gf_false; -} - static int _posix_xattr_get_set_from_backend (posix_xattr_filler_t *filler, char *key) { @@ -142,7 +126,7 @@ _posix_xattr_get_set_from_backend (posix_xattr_filler_t *filler, char *key) char val_buf[256] = {0}; gf_boolean_t have_val = _gf_false; - if (!posix_is_valid_namespace (key)) { + if (!gf_is_valid_xattr_namespace (key)) { ret = -1; goto out; } -- cgit