From e4784f26bf9739853379ec13d0f921ddfb954475 Mon Sep 17 00:00:00 2001 From: hari gowtham Date: Thu, 28 Sep 2017 15:43:30 +0530 Subject: Posix: fix additional inode ref Problem: In the iteration, the inode is being ref-ed twice and unref-ed once. this leads to ref leak. Fix: assign the parent to the inode instead of referencing it. Change-Id: Ib154b12d38ad68220f8f5288bbc50081beccc2b9 BUG: 1496379 Signed-off-by: hari gowtham --- xlators/storage/posix/src/posix-handle.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'xlators') diff --git a/xlators/storage/posix/src/posix-handle.c b/xlators/storage/posix/src/posix-handle.c index 3c8e2417188..38e3198d812 100644 --- a/xlators/storage/posix/src/posix-handle.c +++ b/xlators/storage/posix/src/posix-handle.c @@ -224,13 +224,10 @@ posix_make_ancestryfromgfid (xlator_t *this, char *path, int pathsize, } inode_unref (*parent); - *parent = inode_ref(inode); + *parent = inode; top--; } out: - if (*parent != NULL) { - inode_unref (*parent); - } return ret; } -- cgit