Commit baa40671d3e3b590a33b2c0e022db61cbebf5c00

Authored by Al Viro
1 parent 2d1d9b5b5c

autofs4: make freeing sbi rcu-delayed

makes ->d_managed() safety in RCU mode independent from vfsmount_lock

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

Showing 2 changed files with 5 additions and 9 deletions Side-by-side Diff

fs/autofs4/autofs_i.h
... ... @@ -122,6 +122,7 @@
122 122 spinlock_t lookup_lock;
123 123 struct list_head active_list;
124 124 struct list_head expiring_list;
  125 + struct rcu_head rcu;
125 126 };
126 127  
127 128 static inline struct autofs_sb_info *autofs4_sbi(struct super_block *sb)
... ... @@ -56,18 +56,13 @@
56 56 * just call kill_anon_super when we are called from
57 57 * deactivate_super.
58 58 */
59   - if (!sbi)
60   - goto out_kill_sb;
  59 + if (sbi) /* Free wait queues, close pipe */
  60 + autofs4_catatonic_mode(sbi);
61 61  
62   - /* Free wait queues, close pipe */
63   - autofs4_catatonic_mode(sbi);
64   -
65   - sb->s_fs_info = NULL;
66   - kfree(sbi);
67   -
68   -out_kill_sb:
69 62 DPRINTK("shutting down");
70 63 kill_litter_super(sb);
  64 + if (sbi)
  65 + kfree_rcu(sbi, rcu);
71 66 }
72 67  
73 68 static int autofs4_show_options(struct seq_file *m, struct dentry *root)