diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2018-04-13 00:16:22 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2018-04-18 13:55:49 +0000 |
commit | a7525c507eb682d317dafaa7d06ba59b2c50048d (patch) | |
tree | 0d32d0047094c8d73743bba665bcef00e28d0ddb | |
parent | 52d1b36e3738b7117c5ecf0a83ceba1438fad68a (diff) |
cluster/afr: Make sure latency-arg is passed to afr
xlator_notify doesn't pass the extra arguments that come in the
input function, so XLATOR_NOTIFY macro should be used instead
to pass the extra arguments to the function.
BUG: 1567881
fixes bz#1567881
Change-Id: Ic15b6c446638cbacf3149693147a754219037c47
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
-rw-r--r-- | glusterfsd/src/glusterfsd-mgmt.c | 2 | ||||
-rw-r--r-- | libglusterfs/src/defaults-tmpl.c | 3 | ||||
-rw-r--r-- | libglusterfs/src/xlator.h | 2 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 2 |
4 files changed, 6 insertions, 3 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index d2b39494e51..43f7f6cf043 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -770,7 +770,7 @@ glusterfs_handle_translator_op (rpcsvc_request_t *req) snprintf (key, sizeof (key), "xl-%d", i); ret = dict_get_str (input, key, &xname); xlator = xlator_search_by_name (any, xname); - XLATOR_NOTIFY (xlator, GF_EVENT_TRANSLATOR_OP, input, output); + XLATOR_NOTIFY (ret, xlator, GF_EVENT_TRANSLATOR_OP, input, output); /* If notify fails for an xlator we need to capture it but * continue with the loop. */ if (ret) diff --git a/libglusterfs/src/defaults-tmpl.c b/libglusterfs/src/defaults-tmpl.c index b9f6274800e..d1e919aebc8 100644 --- a/libglusterfs/src/defaults-tmpl.c +++ b/libglusterfs/src/defaults-tmpl.c @@ -122,6 +122,7 @@ default_release (xlator_t *this, fd_t *fd) int default_notify (xlator_t *this, int32_t event, void *data, ...) { + GF_UNUSED int ret = 0; switch (event) { case GF_EVENT_PARENT_UP: case GF_EVENT_PARENT_DOWN: @@ -179,7 +180,7 @@ default_notify (xlator_t *this, int32_t event, void *data, ...) while (parent) { if (parent->xlator->init_succeeded) - xlator_notify (parent->xlator, event, + XLATOR_NOTIFY (ret, parent->xlator, event, this, data); parent = parent->next; } diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h index be6cf60e8c7..f41ebddd9a9 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -1135,7 +1135,7 @@ typedef struct { #define xlator_has_parent(xl) (xl->parents != NULL) -#define XLATOR_NOTIFY(_xl, params ...) \ +#define XLATOR_NOTIFY(ret, _xl, params ...) \ do { \ xlator_t *_old_THIS = NULL; \ \ diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index caea2d35908..21d0fee141f 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -4643,6 +4643,8 @@ afr_priv_dump (xlator_t *this) gf_proc_dump_write(key, "%s", priv->pending_key[i]); sprintf (key, "pending_reads[%d]", i); gf_proc_dump_write(key, "%"PRId64, GF_ATOMIC_GET(priv->pending_reads[i])); + sprintf (key, "child_latency[%d]", i); + gf_proc_dump_write(key, "%"PRId64, priv->child_latency[i]); } gf_proc_dump_write("data_self_heal", "%s", priv->data_self_heal); gf_proc_dump_write("metadata_self_heal", "%d", priv->metadata_self_heal); |