summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryanping.gao <yanping.gao@xtaotech.com>2016-08-26 09:10:11 +0300
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-08-26 08:03:08 -0700
commit1b6c7d62a78aae3f3f123e3ed82882de3745c827 (patch)
tree2c07b52e2d9e152657c0edaba2a7db7d00758b49
parentace4ff98991660c516e84590ce59054c042be4d1 (diff)
features/locks: fix fdctx leak in locks xlators
Problem: Locks xlators is leaking fdctx in pl_release when inode_ctx_get return non-zero Fix: This patch fixes fdctx leak in pl_release path > Reviewed-on: http://review.gluster.org/15302 > Smoke: Gluster Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> > Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Change-Id: Icd5c5c681b7d890e7971b3b06d4258a51d45097d BUG: 1370388 Signed-off-by: Yanping.gao <yanping.gao@xtaotech.com> Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name> Reviewed-on: http://review.gluster.org/15322 Smoke: Gluster Build System <jenkins@build.gluster.org> 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>
-rw-r--r--xlators/features/locks/src/posix.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index 76c7c4ee7ce..36dc32eacc0 100644
--- a/xlators/features/locks/src/posix.c
+++ b/xlators/features/locks/src/posix.c
@@ -2119,7 +2119,7 @@ pl_release (xlator_t *this, fd_t *fd)
ret = inode_ctx_get (fd->inode, this, &tmp_pl_inode);
if (ret != 0)
- goto out;
+ goto clean;
pl_inode = (pl_inode_t *)(long)tmp_pl_inode;
@@ -2131,6 +2131,7 @@ pl_release (xlator_t *this, fd_t *fd)
delete_locks_of_fd (this, pl_inode, fd);
pl_update_refkeeper (this, fd->inode);
+clean:
ret = fd_ctx_del (fd, this, &tmp);
if (ret) {
gf_log (this->name, GF_LOG_DEBUG,