summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2011-03-18 11:44:48 -0700
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-21 00:45:38 -0400
commita872d5101008b091035d579897bccefdeff70def (patch)
treebd67c94ab043022f3ab0e9cf8954e5c69a10f37b
parentb7ed78f56575074f29ec99d8984f347f6c99c914 (diff)
downloadlinux-a872d5101008b091035d579897bccefdeff70def.tar.gz
linux-a872d5101008b091035d579897bccefdeff70def.tar.bz2
linux-a872d5101008b091035d579897bccefdeff70def.zip
pstore: fix leaking ->i_private
Move kfree() of i_private out of ->unlink() and into ->evict_inode() Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/pstore/inode.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
index 08342232cb1c..f777f2902c49 100644
--- a/fs/pstore/inode.c
+++ b/fs/pstore/inode.c
@@ -73,11 +73,16 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry)
struct pstore_private *p = dentry->d_inode->i_private;
p->erase(p->id);
- kfree(p);
return simple_unlink(dir, dentry);
}
+static void pstore_evict_inode(struct inode *inode)
+{
+ end_writeback(inode);
+ kfree(inode->i_private);
+}
+
static const struct inode_operations pstore_dir_inode_operations = {
.lookup = simple_lookup,
.unlink = pstore_unlink,
@@ -110,6 +115,7 @@ static struct inode *pstore_get_inode(struct super_block *sb,
static const struct super_operations pstore_ops = {
.statfs = simple_statfs,
.drop_inode = generic_delete_inode,
+ .evict_inode = pstore_evict_inode,
.show_options = generic_show_options,
};