summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-inode-read.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2016-03-03 23:17:17 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-03-08 06:13:46 -0800
commitd1d364634dce0c3dcfe9c2efc883c21af0494d0d (patch)
tree2af79ed651eb41643095b752844d4df9d169b02a /xlators/cluster/afr/src/afr-inode-read.c
parenteea4175addff08d010c2f7c6446397561b1cd919 (diff)
afr: misc performance improvements
1. In afr_getxattr_cbk, consider the errno value before blindly launching an inode refresh and a subsequent retry on other children. 2. We want to accuse small files only when we know for sure that there is no IO happening on that inode. Otherwise, the ia_sizes obtained in the post-inode-refresh replies may mismatch due to a race between inode-refresh and ongoing writes, causing spurious heal launches. Change-Id: Ife180f4fa5e584808c1077aacdc2423897675d33 BUG: 1309462 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/13595 Smoke: Gluster Build System <jenkins@build.gluster.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-read.c')
-rw-r--r--xlators/cluster/afr/src/afr-inode-read.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c
index caa2a97d6d8..1690cb684dd 100644
--- a/xlators/cluster/afr/src/afr-inode-read.c
+++ b/xlators/cluster/afr/src/afr-inode-read.c
@@ -472,7 +472,16 @@ afr_filter_xattrs (dict_t *dict)
}
}
+static
+gf_boolean_t
+afr_getxattr_ignorable_errnos (int32_t op_errno)
+{
+ if (op_errno == ENODATA || op_errno == ENOTSUP || op_errno == ERANGE ||
+ op_errno == ENAMETOOLONG)
+ return _gf_true;
+ return _gf_false;
+}
int
afr_getxattr_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
@@ -482,7 +491,7 @@ afr_getxattr_cbk (call_frame_t *frame, void *cookie,
local = frame->local;
- if (op_ret < 0) {
+ if (op_ret < 0 && !afr_getxattr_ignorable_errnos(op_errno)) {
local->op_ret = op_ret;
local->op_errno = op_errno;