From 95d07a3d2d68805d93d36a447436e27c48777939 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Thu, 5 Jan 2017 15:36:02 +0530 Subject: ec: Invalidations in disperse volume should not update the stat 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. BUG: 1410375 Change-Id: Id89d2283478e70b62b435a8891fffc86d2be8cb2 Signed-off-by: Poornima G Reviewed-on: http://review.gluster.org/16329 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Xavier Hernandez CentOS-regression: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/cluster/ec/src/ec.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'xlators/cluster/ec/src/ec.c') 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); } -- cgit