From 761e2dc0432d3723e0f8cbb1cf192ad386addb08 Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Tue, 4 Apr 2017 15:50:29 +0530 Subject: 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 Reviewed-on: https://review.gluster.org/16989 Reviewed-by: Prashanth Pai Smoke: Gluster Build System Reviewed-by: jiffin tony Thottan Reviewed-by: Niels de Vos NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System --- api/src/glfs-fops.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'api/src') 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; -- cgit