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