summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2017-01-05 15:36:02 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2017-01-17 06:55:46 -0800
commitbec0532b9536d91629cb502eec2f48c443ac3b49 (patch)
tree096e9b44e4e1e68f72171788a1c68bf8bbebc504 /xlators
parent042d4aaa55706332d5390d8ee01c6a747c6c3118 (diff)
ec: Invalidations in disperse volume should not update the stat
Backport of http://review.gluster.org/16329 Issue: In disperse volume, the file is present across bricks, hence the stat from one brick doesn't carry the valid size of the file. Therefore the upcall from one brick updating the md-cache results in wrong size being updated. Fix: If the notification is cache invalidation then, indicate md-cache that the attributes is invalid. >Reviewed-on: http://review.gluster.org/16329 >Smoke: Gluster Build System <jenkins@build.gluster.org> >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> >CentOS-regression: Gluster Build System <jenkins@build.gluster.org> >Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> (cherry picked from commit 95d07a3d2d68805d93d36a447436e27c48777939) BUG: 1410688 Change-Id: Id89d2283478e70b62b435a8891fffc86d2be8cb2 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/16341 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: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/afr/src/afr-common.c3
-rw-r--r--xlators/cluster/ec/src/ec.c13
-rw-r--r--xlators/performance/md-cache/src/md-cache.c4
3 files changed, 16 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 6fbfda3934a..915ec749dd2 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -4809,8 +4809,7 @@ afr_notify (xlator_t *this, int32_t event,
break;
for (i = 0; i < priv->child_count; i++) {
if (dict_get (up_ci->dict, priv->pending_key[i])) {
- ret = dict_set_int8 (up_ci->dict,
- MDC_INVALIDATE_IATT, 0);
+ up_ci->flags |= UP_INVAL_ATTR;
itable = ((xlator_t *)this->graph->top)->itable;
/*Internal processes may not have itable for top xlator*/
if (itable)
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
index 677761256b4..4d550176f19 100644
--- a/xlators/cluster/ec/src/ec.c
+++ b/xlators/cluster/ec/src/ec.c
@@ -11,6 +11,7 @@
#include "defaults.h"
#include "statedump.h"
#include "compat-errno.h"
+#include "upcall-utils.h"
#include "ec.h"
#include "ec-messages.h"
@@ -472,10 +473,21 @@ ec_notify (xlator_t *this, int32_t event, void *data, void *data2)
dict_t *output = NULL;
gf_boolean_t propagate = _gf_true;
int32_t orig_event = event;
+ struct gf_upcall *up_data = NULL;
+ struct gf_upcall_cache_invalidation *up_ci = NULL;
gf_msg_trace (this->name, 0, "NOTIFY(%d): %p, %p",
event, data, data2);
+ if (event == GF_EVENT_UPCALL) {
+ up_data = (struct gf_upcall *)data;
+ if (up_data->event_type == GF_UPCALL_CACHE_INVALIDATION) {
+ up_ci = (struct gf_upcall_cache_invalidation *)up_data->data;
+ up_ci->flags |= UP_INVAL_ATTR;
+ }
+ goto done;
+ }
+
if (event == GF_EVENT_TRANSLATOR_OP) {
if (!ec->up) {
error = -1;
@@ -542,6 +554,7 @@ ec_notify (xlator_t *this, int32_t event, void *data, void *data2)
unlock:
UNLOCK (&ec->lock);
+done:
if (propagate) {
error = default_notify (this, event, data);
}
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
index 68a9d912319..0ea6cd33e8c 100644
--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -2645,8 +2645,8 @@ mdc_invalidate (xlator_t *this, void *data)
goto out;
}
- if ((up_ci->flags & (UP_NLINK | UP_RENAME_FLAGS | UP_FORGET)) ||
- (up_ci->dict && dict_get (up_ci->dict, MDC_INVALIDATE_IATT))) {
+ if (up_ci->flags &
+ (UP_NLINK | UP_RENAME_FLAGS | UP_FORGET | UP_INVAL_ATTR)) {
mdc_inode_iatt_invalidate (this, inode);
mdc_inode_xatt_invalidate (this, inode);
INCREMENT_ATOMIC (conf->mdc_counter.lock,