[PATCH] autofs3: Make sure all dentries refs are released before calling kill_anon_su...
authorDavid Howells <dhowells@redhat.com>
Fri, 20 Oct 2006 06:28:36 +0000 (23:28 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 20 Oct 2006 17:26:38 +0000 (10:26 -0700)
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>
fs/autofs/autofs_i.h
fs/autofs/dirhash.c
fs/autofs/init.c
fs/autofs/inode.c

index c7700d9b3f96792b74651d8d3890b396976204a2..906ba5ce22617b12d7d3000eaab056f495b4159d 100644 (file)
@@ -149,6 +149,7 @@ extern const struct file_operations autofs_root_operations;
 /* Initializing function */
 
 int autofs_fill_super(struct super_block *, void *, int);
+void autofs_kill_sb(struct super_block *sb);
 
 /* Queue management functions */
 
index 3fded389d06b9fe1e1d8df20f08ac541b87f9bb1..bf8c8af980044462ece05e7fc9772d0efb9d6c13 100644 (file)
@@ -246,5 +246,4 @@ void autofs_hash_nuke(struct autofs_sb_info *sbi)
                        kfree(ent);
                }
        }
-       shrink_dcache_sb(sbi->sb);
 }
index aca12375240694975523badc164647cb10ca01c1..cea5219b4f377ba00b3deb95f58455986764d676 100644 (file)
@@ -24,7 +24,7 @@ static struct file_system_type autofs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "autofs",
        .get_sb         = autofs_get_sb,
-       .kill_sb        = kill_anon_super,
+       .kill_sb        = autofs_kill_sb,
 };
 
 static int __init init_autofs_fs(void)
index 2c9759baad61bf0f875c4adbb4abba6e8fdebb04..54c518c89e4cf86a8fec90124f21d7ca2e776169 100644 (file)
@@ -20,7 +20,7 @@
 #include "autofs_i.h"
 #include <linux/module.h>
 
-static void autofs_put_super(struct super_block *sb)
+void autofs_kill_sb(struct super_block *sb)
 {
        struct autofs_sb_info *sbi = autofs_sbi(sb);
        unsigned int n;
@@ -37,13 +37,13 @@ static void autofs_put_super(struct super_block *sb)
        kfree(sb->s_fs_info);
 
        DPRINTK(("autofs: shutting down\n"));
+       kill_anon_super(sb);
 }
 
 static void autofs_read_inode(struct inode *inode);
 
 static struct super_operations autofs_sops = {
        .read_inode     = autofs_read_inode,
-       .put_super      = autofs_put_super,
        .statfs         = simple_statfs,
 };