diff options
| author | hari gowtham <hgowtham@redhat.com> | 2017-09-28 15:43:30 +0530 | 
|---|---|---|
| committer | jiffin tony Thottan <jthottan@redhat.com> | 2017-10-06 06:33:13 +0000 | 
| commit | d167bb0871f9fc8b150f026bb0a0710bd203c947 (patch) | |
| tree | fdb608c0b3a4e73ef64ea2f3cbb5f0c3e4850169 | |
| parent | 30137cd53c52d435413feb0eddcf7d3a80f2ebbe (diff) | |
Posix: fix additional inode ref
        backport of https://review.gluster.org/#/c/18406/
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.
>BUG: 1496379
Change-Id: Ib154b12d38ad68220f8f5288bbc50081beccc2b9
BUG: 1497084
Signed-off-by: hari gowtham <hgowtham@redhat.com>
| -rw-r--r-- | xlators/storage/posix/src/posix-handle.c | 5 | 
1 files changed, 1 insertions, 4 deletions
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;  }  | 
