cb8e9e
From 650f9b02e96c5b4721f19c5b7515e238edac64f5 Mon Sep 17 00:00:00 2001
cb8e9e
From: Pranith Kumar K <pkarampu@redhat.com>
cb8e9e
Date: Mon, 6 Jul 2015 12:22:20 +0530
cb8e9e
Subject: [PATCH 206/212] cluster/ec: Remove failed subvols from source/sink computation
cb8e9e
cb8e9e
        Backport of http://review.gluster.com/11546
cb8e9e
cb8e9e
Change-Id: Ib0de34c86ee25de361ec821d4015296c514742e0
cb8e9e
BUG: 1240168
cb8e9e
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/52360
cb8e9e
---
cb8e9e
 xlators/cluster/ec/src/ec-heal.c |    7 ++++++-
cb8e9e
 1 files changed, 6 insertions(+), 1 deletions(-)
cb8e9e
cb8e9e
diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c
cb8e9e
index 6ee1f9e..6f82203 100644
cb8e9e
--- a/xlators/cluster/ec/src/ec-heal.c
cb8e9e
+++ b/xlators/cluster/ec/src/ec-heal.c
cb8e9e
@@ -471,6 +471,8 @@ ec_heal_metadata_find_direction (ec_t *ec, default_args_cbk_t *replies,
cb8e9e
         for (i = 0; i < ec->nodes; i++) {
cb8e9e
                 if (!replies[i].valid)
cb8e9e
                         continue;
cb8e9e
+                if (replies[i].op_ret < 0)
cb8e9e
+                        continue;
cb8e9e
                 ret = ec_dict_del_array (replies[i].xdata, EC_XATTR_VERSION,
cb8e9e
                                          xattr, EC_VERSION_SIZE);
cb8e9e
                 if (ret == 0) {
cb8e9e
@@ -489,6 +491,8 @@ ec_heal_metadata_find_direction (ec_t *ec, default_args_cbk_t *replies,
cb8e9e
                 same_count = 1;
cb8e9e
                 source_ia = replies[i].stat;
cb8e9e
                 for (j = i + 1; j < ec->nodes; j++) {
cb8e9e
+                        if (!replies[j].valid || replies[j].op_ret < 0)
cb8e9e
+                                continue;
cb8e9e
                         child_ia = replies[j].stat;
cb8e9e
                         if (!IA_EQUAL(source_ia, child_ia, gfid) ||
cb8e9e
                             !IA_EQUAL(source_ia, child_ia, type) ||
cb8e9e
@@ -517,7 +521,7 @@ ec_heal_metadata_find_direction (ec_t *ec, default_args_cbk_t *replies,
cb8e9e
         for (i = 0; i < ec->nodes; i++) {
cb8e9e
                 if (groups[i] == groups[same_source])
cb8e9e
                         sources[i] = 1;
cb8e9e
-                else if (replies[i].valid)
cb8e9e
+                else if (replies[i].valid && replies[i].op_ret >= 0)
cb8e9e
                         healed_sinks[i] = 1;
cb8e9e
         }
cb8e9e
         ret = same_source;
cb8e9e
@@ -606,6 +610,7 @@ __ec_removexattr_sinks (call_frame_t *frame, ec_t *ec, inode_t *inode,
cb8e9e
                 if (ret < 0) {
cb8e9e
                         sources[i] = 0;
cb8e9e
                         healed_sinks[i] = 0;
cb8e9e
+                        continue;
cb8e9e
                 }
cb8e9e
 
cb8e9e
                 if (replies[i].xdata->count == 0) {
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e