Blob Blame History Raw
From 5522124c2b9e4b3c31950561bb8a4e332b656532 Mon Sep 17 00:00:00 2001
From: Poornima G <pgurusid@redhat.com>
Date: Fri, 29 Jul 2016 15:03:47 +0530
Subject: [PATCH 122/141] md-cache: Fix wrong cache time update for xattrs

In md-cache, the cache has two times:
1. Time when the stat was last fetched for that inode
2. Time when the xattrs were last fetched for that inode. This
time should not be updated when only one of the xattrs is updated.
If, its updated when one of the cached xattr is changed, it can so
happen that the other xattrs have past their cache timeout, but are
still served from cache.

Solution:
Do not update the xattr cache time, when one of the xattrs being cached
is changed. With this, we may end up in cache timeout though it was
updated recently, but it is not a harm. The other way is to have
timeout for every xattr that is being cached. Its more complicated, and
may be not worth it, as we have lot of lookup fops, that are overloaded to
get all the xattrs.

Change-Id: Id77e547f403fc792348f1ea56b468b9260a5a34f
BUG: 1284873
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/15045
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/87035
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Tested-by: Rajesh Joseph <rjoseph@redhat.com>
---
 xlators/performance/md-cache/src/md-cache.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
index ab9860b..a8fabb5 100644
--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -732,8 +732,6 @@ mdc_inode_xatt_update (xlator_t *this, inode_t *inode, dict_t *dict)
 			UNLOCK(&mdc->lock);
 			goto out;
 		}
-
-                time (&mdc->xa_time);
         }
         UNLOCK (&mdc->lock);
 
-- 
1.7.1