summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-common.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 66978a910aa..953df5a67a4 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -1743,14 +1743,23 @@ afr_self_heal_lookup_unwind (call_frame_t *frame, xlator_t *this,
afr_lookup_done_success_action (frame, this, _gf_true);
xattr = local->cont.lookup.xattr;
- if (xattr) {
+ if (!xattr)
+ goto out;
+
+ if (sh_failed) {
ret = dict_set_int32 (xattr, "sh-failed", sh_failed);
if (ret)
gf_log (this->name, GF_LOG_ERROR, "%s: Failed to set "
"sh-failed to %d", local->loc.path, sh_failed);
-
- if (local->self_heal.actual_sh_started == _gf_true &&
- sh_failed == 0) {
+ } else {
+ ret = dict_set_int32 (xattr, "metadata-self-heal-pending",
+ local->self_heal.metadata_sh_pending);
+ ret = dict_set_int32 (xattr, "data-self-heal-pending",
+ local->self_heal.data_sh_pending);
+ ret = dict_set_int32 (xattr, "entry-self-heal-pending",
+ local->self_heal.entry_sh_pending);
+
+ if (local->self_heal.actual_sh_started == _gf_true) {
ret = dict_set_int32 (xattr, "actual-sh-done", 1);
if (ret)
gf_log(this->name, GF_LOG_ERROR, "%s: Failed to"
@@ -2511,6 +2520,10 @@ afr_lookup (call_frame_t *frame, xlator_t *this,
&local->foreground_self_heal);
dict_del (xattr_req, "foreground-self-heal");
+ ret = dict_get_int32 (xattr_req, "dry-run-self-heal",
+ &local->self_heal.dry_run);
+ dict_del (xattr_req, "dry-run-self-heal");
+
ret = afr_lookup_xattr_req_prepare (local, this, xattr_req, &local->loc,
&gfid_req);
if (ret) {