From 12da472023f20ec0950d6a16125edd79e46812a0 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. Cherry picked from commit 761e2dc0432d3723e0f8cbb1cf192ad386addb08: > 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 Change-Id: I75ea952a6b2df58c385f4f53398e5562f255248d BUG: 1435779 Signed-off-by: Niels de Vos Reviewed-on: https://review.gluster.org/17074 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Prashanth Pai Reviewed-by: jiffin tony Thottan Reviewed-by: soumya k CentOS-regression: Gluster Build System --- api/src/glfs-fops.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'api') diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index ea61c8b7a43..a56c000f724 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -4528,6 +4528,9 @@ out: if (fd) fd_unref(fd); + if (inode) + inode_unref (inode); + glfs_subvol_done (fs, subvol); __GLFS_EXIT_FS; @@ -4596,6 +4599,9 @@ out: if (fd) fd_unref(fd); + if (inode) + inode_unref (inode); + glfs_subvol_done (fs, subvol); __GLFS_EXIT_FS; -- cgit