diff options
author | HuangShujun <549702281@qq.com> | 2019-12-05 10:07:10 +0200 |
---|---|---|
committer | Krutika Dhananjay <kdhananj@redhat.com> | 2020-01-10 05:59:22 +0000 |
commit | 98a940f0d42d42125821dbd0e08a2271c01dfc26 (patch) | |
tree | 70c9dfd45513cfe872e2e88cf3f730edd9ca9484 | |
parent | 2fc16af00b12b3aa92d373aa1d5a4b9fd6ce6b94 (diff) |
To fix readdir-ahead memory leak
Glusterfs client process has memory leak if create serveral files under one folder, and delete the folder.
According to statedump, the ref counts of readdir-ahead is bigger than zero in the inode table. Readdir-ahead get parent inode by inode_parent in rda_mark_inode_dirty when each rda_writev_cbk,the inode ref count of parent folder will be increased in inode_parent, but readdir-ahead do not unref it later.
The correction is unref the parent inode at the end of rda_mark_inode_dirty
Backport of:
> Change-Id: Iee68ab1089cbc2fbc4185b93720fb1f66ee89524
> Fixes: bz#1779055
> Signed-off-by: HuangShujun <549702281@qq.com>
Change-Id: Iee68ab1089cbc2fbc4185b93720fb1f66ee89524
(cherry picked from commit 99044a5cedcff9a9eec40a07ecb32bd66271cd02)
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Fixes: bz#1789336
-rw-r--r-- | xlators/performance/readdir-ahead/src/readdir-ahead.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead.c b/xlators/performance/readdir-ahead/src/readdir-ahead.c index 7fd4f8d0618..933941d8a92 100644 --- a/xlators/performance/readdir-ahead/src/readdir-ahead.c +++ b/xlators/performance/readdir-ahead/src/readdir-ahead.c @@ -254,6 +254,7 @@ rda_mark_inode_dirty(xlator_t *this, inode_t *inode) } } UNLOCK(&parent->lock); + inode_unref(parent); } return; |