summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2016-08-25 15:43:29 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-08-30 23:40:52 -0700
commitfe929224c47d5c82da5650e9e1041645a8d7f244 (patch)
tree7d2fbb55598db70d5dc4c43b671828da3a2ea4db /xlators/performance
parent065a27948c4e0651f5bdac1703939adf34e5380e (diff)
md-cache: Process all the cache invalidation flags
Currently, md-cache only processes IATT_UPDATE_FLAGS, UP_XATTR and UP_XATTR_RM. We also need to process UP_RENAME_FLAGS, UP_FORGET, UP_PARENT_DENTRY_FLAGS and UP_NLINK_FLAGS. Otherwise the files unlinked or renamed will not be reflected on other mounts. Change-Id: Icb8b03da51482c3fc2e2a7292d16d56e11a341d9 BUG: 1211863 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/15324 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/md-cache/src/md-cache.c43
1 files changed, 38 insertions, 5 deletions
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
index 586a203398b..6359840f49d 100644
--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -831,6 +831,26 @@ out:
}
+static int
+mdc_update_gfid_stat (xlator_t *this, struct iatt *iatt)
+{
+ int ret = 0;
+ inode_table_t *itable = NULL;
+ inode_t *inode = NULL;
+
+ itable = ((xlator_t *)this->graph->top)->itable;
+ inode = inode_find (itable, iatt->ia_gfid);
+ if (!inode) {
+ ret = -1;
+ goto out;
+ }
+ ret = mdc_inode_iatt_set_validate (this, inode, NULL,
+ iatt);
+out:
+ return ret;
+}
+
+
void
mdc_load_reqs (xlator_t *this, dict_t *dict)
{
@@ -2521,12 +2541,24 @@ mdc_invalidate (xlator_t *this, void *data)
goto out;
}
+ if (up_ci->flags & UP_PARENT_DENTRY_FLAGS) {
+ mdc_update_gfid_stat (this, &up_ci->p_stat);
+ if (up_ci->flags & UP_RENAME_FLAGS)
+ mdc_update_gfid_stat (this, &up_ci->oldp_stat);
+ }
+
+ if ((up_ci->flags & (UP_NLINK | UP_RENAME_FLAGS | UP_FORGET)) ||
+ (up_ci->dict && dict_get (up_ci->dict, MDC_INVALIDATE_IATT))) {
+ mdc_inode_iatt_invalidate (this, inode);
+ mdc_inode_xatt_invalidate (this, inode);
+ INCREMENT_ATOMIC (conf->mdc_counter.lock,
+ conf->mdc_counter.stat_invals);
+ goto out;
+ }
+
if (up_ci->flags & IATT_UPDATE_FLAGS) {
- if (up_ci->dict && dict_get (up_ci->dict, MDC_INVALIDATE_IATT))
- mdc_inode_iatt_invalidate (this, inode);
- else
- ret = mdc_inode_iatt_set_validate (this, inode, NULL,
- &up_ci->stat);
+ ret = mdc_inode_iatt_set_validate (this, inode, NULL,
+ &up_ci->stat);
/* one of the scenarios where ret < 0 is when this invalidate
* is older than the current stat, in that case do not
* update the xattrs as well
@@ -2536,6 +2568,7 @@ mdc_invalidate (xlator_t *this, void *data)
INCREMENT_ATOMIC (conf->mdc_counter.lock,
conf->mdc_counter.stat_invals);
}
+
if (up_ci->flags & UP_XATTR) {
if (up_ci->dict)
ret = mdc_inode_xatt_update (this, inode, up_ci->dict);