From 50fa85c071553b41f33a8167b31c8a9b54cfe3e3 Mon Sep 17 00:00:00 2001 From: "yanping.gao" Date: Wed, 24 Aug 2016 06:47:49 +0000 Subject: 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 > CentOS-regression: Gluster Build System > NetBSD-regression: NetBSD Build System > Reviewed-by: Pranith Kumar Karampuri > Tested-by: Pranith Kumar Karampuri Change-Id: Icd5c5c681b7d890e7971b3b06d4258a51d45097d BUG: 1370390 Signed-off-by: Yanping.gao Signed-off-by: Oleksandr Natalenko Reviewed-on: http://review.gluster.org/15323 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/features/locks/src/posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index b625178c0e1..3415d59324c 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -2588,7 +2588,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; @@ -2600,6 +2600,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, -- cgit