mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Erez Zadok <ezk@cs.sunysb.edu>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] unionfs: fix memory leak
Date: Sun, 29 Jun 2008 01:07:15 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0806290105430.20280@blonde.site> (raw)
In-Reply-To: <Pine.LNX.4.64.0806290101160.20280@blonde.site>

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;
 }

  reply	other threads:[~2008-06-29  0:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-29  0:05 [PATCH] fsstack: fsstack_copy_inode_size locking Hugh Dickins
2008-06-29  0:07 ` Hugh Dickins [this message]
2008-06-30 18:11   ` [PATCH] unionfs: fix memory leak Erez Zadok
2008-06-29  7:15 ` [PATCH] fsstack: fsstack_copy_inode_size locking Christoph Hellwig
2008-06-29 11:56   ` Hugh Dickins
2008-06-30 18:19     ` Erez Zadok
2008-06-30 21:49       ` Michael Halcrow
2008-07-01  7:03         ` Christoph Hellwig
2008-07-02  0:00           ` Erez Zadok
2008-06-30  4:31 ` hooanon05
2008-06-30 12:10   ` Hugh Dickins
2008-06-30 13:08     ` hooanon05

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0806290105430.20280@blonde.site \
    --to=hugh@veritas.com \
    --cc=akpm@linux-foundation.org \
    --cc=ezk@cs.sunysb.edu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®