summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.c
diff options
context:
space:
mode:
authorAnuradha Talur <atalur@redhat.com>2015-11-23 15:56:28 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-12-21 01:19:05 -0800
commitfbcd691b593cba29ba9c54d3da2c685787f719be (patch)
tree8c6fb950f79f261e7c61e849045ddd8e85062af9 /xlators/cluster/afr/src/afr-self-heal-common.c
parentcf1667cf2fdc9306ae23db1c171b6bdb225153d7 (diff)
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 <atalur@redhat.com> Reviewed-on: http://review.gluster.org/12854 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c19
1 files changed, 15 insertions, 4 deletions
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])