diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2014-08-27 15:14:04 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-16 04:14:36 -0700 |
commit | 1343efc2b5fc65b84afabb51ac537537ccb27722 (patch) | |
tree | 807fd5e4b4c0d3b291040304cb08718a5e585c0a /xlators/cluster/afr/src/afr-self-heal-entry.c | |
parent | 516677dc5f0c8ec9ad367a7487ae45e6e3d8be05 (diff) |
cluster/afr: Fix dict_t leaks
Backport of: http://review.gluster.org/#/c/8557/
dict_t objects that are ref'd in alloca'd "replies" in
afr_replies_copy() are not unref'd before "replies" go out of scope.
Change-Id: I9bb45bc673ec13292ac96dda060aceb48739ebe8
BUG: 1136831
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/8704
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-entry.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-entry.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index dc1546c7403..97397c1b098 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -342,6 +342,8 @@ unlock: locked_on); if (inode) inode_unref (inode); + if (replies) + afr_replies_wipe (replies, priv->child_count); return ret; } @@ -404,8 +406,7 @@ afr_selfheal_entry_do_subvol (call_frame_t *frame, xlator_t *this, fd_t *fd, static int afr_selfheal_entry_do (call_frame_t *frame, xlator_t *this, fd_t *fd, int source, unsigned char *sources, - unsigned char *healed_sinks, - struct afr_reply *locked_replies) + unsigned char *healed_sinks) { int i = 0; afr_private_t *priv = NULL; @@ -431,8 +432,7 @@ afr_selfheal_entry_do (call_frame_t *frame, xlator_t *this, fd_t *fd, static int __afr_selfheal_entry_finalize_source (xlator_t *this, unsigned char *sources, unsigned char *healed_sinks, - unsigned char *locked_on, - struct afr_reply *replies) + unsigned char *locked_on) { int i = 0; afr_private_t *priv = NULL; @@ -493,8 +493,7 @@ __afr_selfheal_entry_prepare (call_frame_t *frame, xlator_t *this, fd_t *fd, AFR_INTERSECT (healed_sinks, sinks, locked_on, priv->child_count); source = __afr_selfheal_entry_finalize_source (this, sources, - healed_sinks, - locked_on, replies); + healed_sinks, locked_on); if (source < 0) { /* If source is < 0 (typically split-brain), we perform a conservative merge of entries rather than erroring out */ @@ -546,7 +545,7 @@ unlock: goto out; ret = afr_selfheal_entry_do (frame, this, fd, source, sources, - healed_sinks, locked_replies); + healed_sinks); if (ret) goto out; @@ -554,6 +553,8 @@ unlock: healed_sinks, AFR_ENTRY_TRANSACTION, locked_replies, data_lock); out: + if (locked_replies) + afr_replies_wipe (locked_replies, priv->child_count); return ret; } |