Commit 0e7d73824e6b0024100701da246fec769dd8f087

Authored by David Howells
Committed by Linus Torvalds
1 parent f2fbc6c2da

[PATCH] autofs3: Make sure all dentries refs are released before calling kill_anon_super()

Make sure all dentries refs are released before calling kill_anon_super()
so that the assumption that generic_shutdown_super() can completely destroy
the dentry tree for there will be no external references holds true.

What was being done in the put_super() superblock op, is now done in the
kill_sb() filesystem op instead, prior to calling kill_anon_super().

The call to shrink_dcache_sb() is removed as it is redundant since
shrink_dcache_for_umount() will now be called after the cleanup routine.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Ian Kent <raven@themaw.net>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 4 changed files with 4 additions and 4 deletions Side-by-side Diff

fs/autofs/autofs_i.h
... ... @@ -149,6 +149,7 @@
149 149 /* Initializing function */
150 150  
151 151 int autofs_fill_super(struct super_block *, void *, int);
  152 +void autofs_kill_sb(struct super_block *sb);
152 153  
153 154 /* Queue management functions */
154 155  
... ... @@ -246,6 +246,5 @@
246 246 kfree(ent);
247 247 }
248 248 }
249   - shrink_dcache_sb(sbi->sb);
250 249 }
... ... @@ -24,7 +24,7 @@
24 24 .owner = THIS_MODULE,
25 25 .name = "autofs",
26 26 .get_sb = autofs_get_sb,
27   - .kill_sb = kill_anon_super,
  27 + .kill_sb = autofs_kill_sb,
28 28 };
29 29  
30 30 static int __init init_autofs_fs(void)
... ... @@ -20,7 +20,7 @@
20 20 #include "autofs_i.h"
21 21 #include <linux/module.h>
22 22  
23   -static void autofs_put_super(struct super_block *sb)
  23 +void autofs_kill_sb(struct super_block *sb)
24 24 {
25 25 struct autofs_sb_info *sbi = autofs_sbi(sb);
26 26 unsigned int n;
27 27  
... ... @@ -37,13 +37,13 @@
37 37 kfree(sb->s_fs_info);
38 38  
39 39 DPRINTK(("autofs: shutting down\n"));
  40 + kill_anon_super(sb);
40 41 }
41 42  
42 43 static void autofs_read_inode(struct inode *inode);
43 44  
44 45 static struct super_operations autofs_sops = {
45 46 .read_inode = autofs_read_inode,
46   - .put_super = autofs_put_super,
47 47 .statfs = simple_statfs,
48 48 };
49 49