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