9ae3f9
From d54f087a2484695ff7ac214d39f2750fddcef2d5 Mon Sep 17 00:00:00 2001
9ae3f9
From: HuangShujun <549702281@qq.com>
9ae3f9
Date: Thu, 5 Dec 2019 10:07:10 +0200
9ae3f9
Subject: [PATCH 387/449] To fix readdir-ahead memory leak
9ae3f9
9ae3f9
Glusterfs client process has memory leak if create several files under
9ae3f9
one folder, and delete the folder. According to statedump, the ref
9ae3f9
counts of readdir-ahead is bigger than zero in the inode table.
9ae3f9
9ae3f9
Readdir-ahead get parent inode by inode_parent in rda_mark_inode_dirty
9ae3f9
when each rda_writev_cbk,the inode ref count of parent folder will be
9ae3f9
increased in inode_parent, but readdir-ahead do not unref it later.
9ae3f9
9ae3f9
The correction is unref the parent inode at the end of
9ae3f9
rda_mark_inode_dirty.
9ae3f9
9ae3f9
Upstream patch:
9ae3f9
> Upstream patch link: https://review.gluster.org/c/glusterfs/+/23815
9ae3f9
> Fixes: bz#1779055
9ae3f9
> Signed-off-by: HuangShujun <549702281@qq.com>
9ae3f9
> Change-Id: Iee68ab1089cbc2fbc4185b93720fb1f66ee89524
9ae3f9
9ae3f9
BUG: 1781550
9ae3f9
Change-Id: Iee68ab1089cbc2fbc4185b93720fb1f66ee89524
9ae3f9
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
9ae3f9
Reviewed-on: https://code.engineering.redhat.com/gerrit/202312
9ae3f9
Tested-by: RHGS Build Bot <nigelb@redhat.com>
9ae3f9
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
9ae3f9
---
9ae3f9
 xlators/performance/readdir-ahead/src/readdir-ahead.c | 1 +
9ae3f9
 1 file changed, 1 insertion(+)
9ae3f9
9ae3f9
diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead.c b/xlators/performance/readdir-ahead/src/readdir-ahead.c
9ae3f9
index 7fd4f8d..933941d 100644
9ae3f9
--- a/xlators/performance/readdir-ahead/src/readdir-ahead.c
9ae3f9
+++ b/xlators/performance/readdir-ahead/src/readdir-ahead.c
9ae3f9
@@ -254,6 +254,7 @@ rda_mark_inode_dirty(xlator_t *this, inode_t *inode)
9ae3f9
             }
9ae3f9
         }
9ae3f9
         UNLOCK(&parent->lock);
9ae3f9
+        inode_unref(parent);
9ae3f9
     }
9ae3f9
 
9ae3f9
     return;
9ae3f9
-- 
9ae3f9
1.8.3.1
9ae3f9