summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c2
-rw-r--r--xlators/cluster/afr/src/afr-self-heald.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 6b39dcf9dbc..df14cbb0fb7 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -907,7 +907,7 @@ afr_selfheal_unlocked_inspect (call_frame_t *frame, xlator_t *this,
goto out;
}
} else if (valid_cnt < 2) {
- ret = -ENOTCONN;
+ ret = -ENOTCONN;
goto out;
}
diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c
index 787cb4ff557..0ff4c0cb1fc 100644
--- a/xlators/cluster/afr/src/afr-self-heald.c
+++ b/xlators/cluster/afr/src/afr-self-heald.c
@@ -303,6 +303,11 @@ afr_shd_selfheal (struct subvol_healer *healer, int child, uuid_t gfid)
subvol = priv->children[child];
+ //If this fails with ENOENT/ESTALE index is stale
+ ret = afr_shd_gfid_to_path (this, subvol, gfid, &path);
+ if (ret < 0)
+ return ret;
+
ret = afr_selfheal (this, gfid);
if (ret == -EIO) {
@@ -316,10 +321,6 @@ afr_shd_selfheal (struct subvol_healer *healer, int child, uuid_t gfid)
crawl_event->healed_count++;
}
- afr_shd_gfid_to_path (this, subvol, gfid, &path);
- if (!path)
- return ret;
-
if (eh) {
shd_event = GF_CALLOC (1, sizeof(*shd_event),
gf_afr_mt_shd_event_t);
@@ -334,6 +335,7 @@ afr_shd_selfheal (struct subvol_healer *healer, int child, uuid_t gfid)
if (eh_save_history (eh, shd_event) < 0) {
GF_FREE (shd_event);
GF_FREE (path);
+ return ret;
}
}
return ret;