summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/cluster/afr/src/afr-common.c5
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c4
-rw-r--r--xlators/cluster/afr/src/afr-self-heal.h2
3 files changed, 8 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 77b68d34c18..aa50e505afe 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -1180,7 +1180,10 @@ afr_inode_refresh_done (call_frame_t *frame, xlator_t *this)
}
heal_local->refreshinode = inode_ref (local->refreshinode);
heal_local->heal_frame = heal_frame;
- afr_throttled_selfheal (heal_frame, this);
+ if (!afr_throttled_selfheal (heal_frame, this)) {
+ AFR_STACK_DESTROY (heal_frame);
+ goto refresh_done;
+ }
}
refresh_done:
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index c3b62e3781a..17e15d760c6 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -2097,7 +2097,7 @@ afr_heal_synctask (xlator_t *this, afr_local_t *local)
afr_refresh_heal_done (ret, heal_frame, heal_frame);
}
-void
+gf_boolean_t
afr_throttled_selfheal (call_frame_t *frame, xlator_t *this)
{
gf_boolean_t can_heal = _gf_true;
@@ -2125,6 +2125,8 @@ afr_throttled_selfheal (call_frame_t *frame, xlator_t *this)
gf_msg_debug (this->name, 0, "Max number of heals are "
"pending, background self-heal rejected.");
}
+
+ return can_heal;
}
int
diff --git a/xlators/cluster/afr/src/afr-self-heal.h b/xlators/cluster/afr/src/afr-self-heal.h
index 80b7f3a125d..500227abe24 100644
--- a/xlators/cluster/afr/src/afr-self-heal.h
+++ b/xlators/cluster/afr/src/afr-self-heal.h
@@ -85,7 +85,7 @@
int
afr_selfheal (xlator_t *this, uuid_t gfid);
-void
+gf_boolean_t
afr_throttled_selfheal (call_frame_t *frame, xlator_t *this);
int