aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/autofs4/inode.c')
-rw-r--r--fs/autofs4/inode.c62
1 files changed, 1 insertions, 61 deletions
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 4670a7818eac..821b2b955dac 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -96,63 +96,6 @@ void autofs4_free_ino(struct autofs_info *ino)
96 kfree(ino); 96 kfree(ino);
97} 97}
98 98
99/*
100 * Deal with the infamous "Busy inodes after umount ..." message.
101 *
102 * Clean up the dentry tree. This happens with autofs if the user
103 * space program goes away due to a SIGKILL, SIGSEGV etc.
104 */
105static void autofs4_force_release(struct autofs_sb_info *sbi)
106{
107 struct dentry *this_parent = sbi->sb->s_root;
108 struct list_head *next;
109
110 if (!sbi->sb->s_root)
111 return;
112
113 spin_lock(&dcache_lock);
114repeat:
115 next = this_parent->d_subdirs.next;
116resume:
117 while (next != &this_parent->d_subdirs) {
118 struct dentry *dentry = list_entry(next, struct dentry, d_u.d_child);
119
120 /* Negative dentry - don`t care */
121 if (!simple_positive(dentry)) {
122 next = next->next;
123 continue;
124 }
125
126 if (!list_empty(&dentry->d_subdirs)) {
127 this_parent = dentry;
128 goto repeat;
129 }
130
131 next = next->next;
132 spin_unlock(&dcache_lock);
133
134 DPRINTK("dentry %p %.*s",
135 dentry, (int)dentry->d_name.len, dentry->d_name.name);
136
137 dput(dentry);
138 spin_lock(&dcache_lock);
139 }
140
141 if (this_parent != sbi->sb->s_root) {
142 struct dentry *dentry = this_parent;
143
144 next = this_parent->d_u.d_child.next;
145 this_parent = this_parent->d_parent;
146 spin_unlock(&dcache_lock);
147 DPRINTK("parent dentry %p %.*s",
148 dentry, (int)dentry->d_name.len, dentry->d_name.name);
149 dput(dentry);
150 spin_lock(&dcache_lock);
151 goto resume;
152 }
153 spin_unlock(&dcache_lock);
154}
155
156void autofs4_kill_sb(struct super_block *sb) 99void autofs4_kill_sb(struct super_block *sb)
157{ 100{
158 struct autofs_sb_info *sbi = autofs4_sbi(sb); 101 struct autofs_sb_info *sbi = autofs4_sbi(sb);
@@ -169,15 +112,12 @@ void autofs4_kill_sb(struct super_block *sb)
169 /* Free wait queues, close pipe */ 112 /* Free wait queues, close pipe */
170 autofs4_catatonic_mode(sbi); 113 autofs4_catatonic_mode(sbi);
171 114
172 /* Clean up and release dangling references */
173 autofs4_force_release(sbi);
174
175 sb->s_fs_info = NULL; 115 sb->s_fs_info = NULL;
176 kfree(sbi); 116 kfree(sbi);
177 117
178out_kill_sb: 118out_kill_sb:
179 DPRINTK("shutting down"); 119 DPRINTK("shutting down");
180 kill_anon_super(sb); 120 kill_litter_super(sb);
181} 121}
182 122
183static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt) 123static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)