dentry leak in simple_fill_super() failure exit
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 2 Apr 2012 23:22:25 +0000 (19:22 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 9 Apr 2012 05:39:22 +0000 (01:39 -0400)
d_genocide() does _not_ evict dentries; it just removes extra ref
pinning each of those.  Normally it's followed by shrinking the
tree (it's done just before generic_shutdown_super() by kill_litter_super()),
but in case of simple_fill_super() nothing of that kind will follow.
Just do shrink_dcache_parent() manually.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/libfs.c

index 358094f..18d08f5 100644 (file)
@@ -529,6 +529,7 @@ int simple_fill_super(struct super_block *s, unsigned long magic,
        return 0;
 out:
        d_genocide(root);
+       shrink_dcache_parent(root);
        dput(root);
        return -ENOMEM;
 }