3604df
From 5522124c2b9e4b3c31950561bb8a4e332b656532 Mon Sep 17 00:00:00 2001
3604df
From: Poornima G <pgurusid@redhat.com>
3604df
Date: Fri, 29 Jul 2016 15:03:47 +0530
3604df
Subject: [PATCH 122/141] md-cache: Fix wrong cache time update for xattrs
3604df
3604df
In md-cache, the cache has two times:
3604df
1. Time when the stat was last fetched for that inode
3604df
2. Time when the xattrs were last fetched for that inode. This
3604df
time should not be updated when only one of the xattrs is updated.
3604df
If, its updated when one of the cached xattr is changed, it can so
3604df
happen that the other xattrs have past their cache timeout, but are
3604df
still served from cache.
3604df
3604df
Solution:
3604df
Do not update the xattr cache time, when one of the xattrs being cached
3604df
is changed. With this, we may end up in cache timeout though it was
3604df
updated recently, but it is not a harm. The other way is to have
3604df
timeout for every xattr that is being cached. Its more complicated, and
3604df
may be not worth it, as we have lot of lookup fops, that are overloaded to
3604df
get all the xattrs.
3604df
3604df
Change-Id: Id77e547f403fc792348f1ea56b468b9260a5a34f
3604df
BUG: 1284873
3604df
Signed-off-by: Poornima G <pgurusid@redhat.com>
3604df
Reviewed-on: http://review.gluster.org/15045
3604df
Smoke: Gluster Build System <jenkins@build.gluster.org>
3604df
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
3604df
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
3604df
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
3604df
Reviewed-on: https://code.engineering.redhat.com/gerrit/87035
3604df
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
3604df
Tested-by: Rajesh Joseph <rjoseph@redhat.com>
3604df
---
3604df
 xlators/performance/md-cache/src/md-cache.c |    2 --
3604df
 1 files changed, 0 insertions(+), 2 deletions(-)
3604df
3604df
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
3604df
index ab9860b..a8fabb5 100644
3604df
--- a/xlators/performance/md-cache/src/md-cache.c
3604df
+++ b/xlators/performance/md-cache/src/md-cache.c
3604df
@@ -732,8 +732,6 @@ mdc_inode_xatt_update (xlator_t *this, inode_t *inode, dict_t *dict)
3604df
 			UNLOCK(&mdc->lock);
3604df
 			goto out;
3604df
 		}
3604df
-
3604df
-                time (&mdc->xa_time);
3604df
         }
3604df
         UNLOCK (&mdc->lock);
3604df
 
3604df
-- 
3604df
1.7.1
3604df