Skip to content

Commit

Permalink
autofs4: make freeing sbi rcu-delayed
Browse files Browse the repository at this point in the history
makes ->d_managed() safety in RCU mode independent from vfsmount_lock

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 25, 2013
1 parent 2d1d9b5 commit baa4067
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions fs/autofs4/autofs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ struct autofs_sb_info {
spinlock_t lookup_lock;
struct list_head active_list;
struct list_head expiring_list;
struct rcu_head rcu;
};

static inline struct autofs_sb_info *autofs4_sbi(struct super_block *sb)
Expand Down
13 changes: 4 additions & 9 deletions fs/autofs4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,13 @@ void autofs4_kill_sb(struct super_block *sb)
* just call kill_anon_super when we are called from
* deactivate_super.
*/
if (!sbi)
goto out_kill_sb;

/* Free wait queues, close pipe */
autofs4_catatonic_mode(sbi);

sb->s_fs_info = NULL;
kfree(sbi);
if (sbi) /* Free wait queues, close pipe */
autofs4_catatonic_mode(sbi);

out_kill_sb:
DPRINTK("shutting down");
kill_litter_super(sb);
if (sbi)
kfree_rcu(sbi, rcu);
}

static int autofs4_show_options(struct seq_file *m, struct dentry *root)
Expand Down

0 comments on commit baa4067

Please sign in to comment.