Skip to content

Commit

Permalink
[PATCH] autofs3: Make sure all dentries refs are released before call…
Browse files Browse the repository at this point in the history
…ing 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 <[email protected]>
Acked-by: Ian Kent <[email protected]>
Cc: Andi Kleen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dhowells authored and Linus Torvalds committed Oct 20, 2006
1 parent f2fbc6c commit 0e7d738
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions fs/autofs/autofs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
1 change: 0 additions & 1 deletion fs/autofs/dirhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,4 @@ void autofs_hash_nuke(struct autofs_sb_info *sbi)
kfree(ent);
}
}
shrink_dcache_sb(sbi->sb);
}
2 changes: 1 addition & 1 deletion fs/autofs/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions fs/autofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
};

Expand Down

0 comments on commit 0e7d738

Please sign in to comment.