From f9daa522408a43b05200abdbecc1ee65b1d6f099 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 16 Jun 2016 12:03:19 +0530 Subject: storage/posix: fix inode leaks > Reviewed-on: http://review.gluster.org/14739 > Smoke: Gluster Build System > CentOS-regression: Gluster Build System > NetBSD-regression: NetBSD Build System > Reviewed-by: N Balachandran > Reviewed-by: Pranith Kumar Karampuri > Reviewed-by: Krutika Dhananjay BUG: 1365742 Change-Id: Ibd221ba62af4db17bea5c52d37f5c0ba30b60a7d Signed-off-by: Raghavendra G Reviewed-on: http://review.gluster.org/15127 Tested-by: Oleksandr Natalenko Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: N Balachandran CentOS-regression: Gluster Build System Reviewed-by: Niels de Vos --- xlators/storage/posix/src/posix-handle.c | 2 ++ xlators/storage/posix/src/posix.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/xlators/storage/posix/src/posix-handle.c b/xlators/storage/posix/src/posix-handle.c index 8e561e4a76f..ddafb0d9b04 100644 --- a/xlators/storage/posix/src/posix-handle.c +++ b/xlators/storage/posix/src/posix-handle.c @@ -989,6 +989,8 @@ posix_create_link_if_gfid_exists (xlator_t *this, uuid_t gfid, char *real_path, } unlock: UNLOCK (&inode->lock); + + inode_unref (inode); } return ret; diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 5b1666c425b..e8404860fa8 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -6195,8 +6195,11 @@ posix_readdirp_fill (xlator_t *this, fd_t *fd, gf_dirent_t *entries, dict_t *dic ret = posix_pstat (this, gfid, hpath, &stbuf); - if (ret == -1) + if (ret == -1) { + if (inode) + inode_unref (inode); continue; + } if (!inode) inode = inode_find (itable, stbuf.ia_gfid); -- cgit