summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorMateusz Slupny <mateusz.slupny@appeartv.com>2016-11-29 12:01:48 +0100
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-12-04 17:30:05 -0800
commitbe1617531beef54afe506833e03e1653c8b2274d (patch)
tree57c5288535454fc576d5b9c2a1974e2d07b49a05 /xlators
parent89ee91e4256029014ccf2f0475d638e0558aa1d5 (diff)
selfheal: fix memory leak on client side healing queue
> Reviewed-on: http://review.gluster.org/15968 > Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> > Reviewed-by: Ravishankar N <ravishankar@redhat.com> > Smoke: Gluster Build System <jenkins@build.gluster.org> (cherry picked from commit fb95eb4da6f4fc0b9c69e3b159a2214fe47e6d1d) Change-Id: I2beaba829710565a3246f7449a5cd21755cf5f7d BUG: 1400926 Signed-off-by: Mateusz Slupny <mateusz.slupny@appeartv.com> Reviewed-on: http://review.gluster.org/16011 Tested-by: Ravishankar N <ravishankar@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Ravishankar N <ravishankar@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators')
-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 d503609e8a2..072c663c5c0 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -1035,7 +1035,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 b6720ccfa5c..858880860e6 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -1996,7 +1996,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;
@@ -2024,6 +2024,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 ec5337e60b2..1705c967f60 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