summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-entry.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c
index 305cafdbe49..b44418dd68e 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -211,6 +211,7 @@ afr_sh_entry_erase_pending (call_frame_t *frame, xlator_t *this)
int call_count = 0;
int i = 0;
dict_t **erase_xattr = NULL;
+ int need_unwind = 0;
local = frame->local;
@@ -231,6 +232,9 @@ afr_sh_entry_erase_pending (call_frame_t *frame, xlator_t *this)
}
}
+ if (call_count == 0)
+ need_unwind = 1;
+
afr_sh_delta_to_xattr (priv, sh->delta_matrix, erase_xattr,
priv->child_count, AFR_ENTRY_TRANSACTION);
@@ -260,6 +264,9 @@ afr_sh_entry_erase_pending (call_frame_t *frame, xlator_t *this)
}
FREE (erase_xattr);
+ if (need_unwind)
+ afr_sh_entry_finish (frame, this);
+
return 0;
}