lkml.org 
[lkml]   [2008]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] unionfs: fix memory leak
Unionfs has slowly been leaking memory: although many places do explicitly
free the dentry's lower_paths array (and I've not changed those, in case
the ordering is important), not all do - and adding a WARN_ON didn't seem
to finger any particular culprit. So free_dentry_private_data needs to
kfree lower_paths (other freeers are good about setting it to NULL).

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---
Should follow mmotm's git-unionfs-fixup.patch

fs/unionfs/lookup.c | 1 +
1 file changed, 1 insertion(+)

--- mmotm/fs/unionfs/lookup.c 2008-06-27 13:39:18.000000000 +0100
+++ linux/fs/unionfs/lookup.c 2008-06-27 14:08:00.000000000 +0100
@@ -498,6 +498,7 @@ void free_dentry_private_data(struct den
{
if (!dentry || !dentry->d_fsdata)
return;
+ kfree(UNIONFS_D(dentry)->lower_paths);
kmem_cache_free(unionfs_dentry_cachep, dentry->d_fsdata);
dentry->d_fsdata = NULL;
}

\
 
 \ /
  Last update: 2008-06-29 02:11    [W:0.115 / U:0.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site