summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2017-04-04 15:50:29 +0530
committerNiels de Vos <ndevos@redhat.com>2017-04-18 07:25:30 -0400
commit761e2dc0432d3723e0f8cbb1cf192ad386addb08 (patch)
tree4e7ef38b2ec628a9200f0d9563a138bc4d0e40d4
parentcc839523364e47dea715cd7241772cd68f05f76c (diff)
gfapi: Fix inode ref leak in anonymous fd I/O APIs
In the APIs to do I/Os using anonymous fd, there is a ref taken for inode which hasn't been unreferenced post the operation. This shall result in the leak. Change-Id: I75ea952a6b2df58c385f4f53398e5562f255248d BUG: 1438738 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: https://review.gluster.org/16989 Reviewed-by: Prashanth Pai <ppai@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--api/src/glfs-fops.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index ca2d3adc14f..0e5b206b98c 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -4527,6 +4527,9 @@ out:
if (fd)
fd_unref(fd);
+ if (inode)
+ inode_unref (inode);
+
glfs_subvol_done (fs, subvol);
__GLFS_EXIT_FS;
@@ -4595,6 +4598,9 @@ out:
if (fd)
fd_unref(fd);
+ if (inode)
+ inode_unref (inode);
+
glfs_subvol_done (fs, subvol);
__GLFS_EXIT_FS;