From fbcd691b593cba29ba9c54d3da2c685787f719be Mon Sep 17 00:00:00 2001 From: Anuradha Talur Date: Mon, 23 Nov 2015 15:56:28 +0530 Subject: heal : Changed heal info to process all indices directories Backport of http://review.gluster.org/#/c/12658/ Change-Id: Ida863844e14309b6526c1b8434273fbf05c410d2 BUG: 1287531 Signed-off-by: Anuradha Talur Reviewed-on: http://review.gluster.org/12854 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/cluster/afr/src/afr-self-heal-common.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 63a52fcae84..f4896f125d4 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -508,7 +508,8 @@ afr_selfheal_find_direction (call_frame_t *frame, xlator_t *this, struct afr_reply *replies, afr_transaction_type type, unsigned char *locked_on, unsigned char *sources, - unsigned char *sinks, uint64_t *witness) + unsigned char *sinks, uint64_t *witness, + gf_boolean_t *pflag) { afr_private_t *priv = NULL; int i = 0; @@ -528,15 +529,25 @@ afr_selfheal_find_direction (call_frame_t *frame, xlator_t *this, matrix = ALLOC_MATRIX(priv->child_count, int); memset (witness, 0, sizeof (*witness) * priv->child_count); + /* First construct the pending matrix for further analysis */ + afr_selfheal_extract_xattr (this, replies, type, dirty, matrix); + + if (pflag) { + for (i = 0; i < priv->child_count; i++) { + for (j = 0; j < priv->child_count; j++) + if (matrix[i][j]) + *pflag = _gf_true; + if (*pflag) + break; + } + } + if (afr_success_count (replies, priv->child_count) < AFR_SH_MIN_PARTICIPANTS) { /* Treat this just like locks not being acquired */ return -ENOTCONN; } - /* First construct the pending matrix for further analysis */ - afr_selfheal_extract_xattr (this, replies, type, dirty, matrix); - /* short list all self-accused */ for (i = 0; i < priv->child_count; i++) { if (matrix[i][i]) -- cgit