aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-06-17 09:32:10 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-06-24 18:39:42 -0400
commit98ab494dd1d25388981114057cf9446250cc7dc7 (patch)
tree504637660e92f4438ed9bd105ac2644ab021813d /fs/cifs
parent97d1152acec0647b72f8c6ecc57da0d6fed574de (diff)
cifs: move cifs_umount() call into ->kill_sb()
instead of calling it manually in case if cifs_read_super() fails to set ->s_root, just call it from ->kill_sb(). cifs_put_super() is gone now *and* we have cifs_sb shutdown and destruction done after the superblock is gone from ->s_instances. Acked-by: Pavel Shilovsky <piastryyy@gmail.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifsfs.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 4004bc647a72..15de4561dbc5 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -163,30 +163,14 @@ out_no_root:
163 if (inode) 163 if (inode)
164 iput(inode); 164 iput(inode);
165 165
166 cifs_umount(cifs_sb);
167 return rc; 166 return rc;
168} 167}
169 168
170static void
171cifs_put_super(struct super_block *sb)
172{
173 int rc = 0;
174 struct cifs_sb_info *cifs_sb;
175
176 cFYI(1, "In cifs_put_super");
177 cifs_sb = CIFS_SB(sb);
178 if (cifs_sb == NULL) {
179 cFYI(1, "Empty cifs superblock info passed to unmount");
180 return;
181 }
182
183 cifs_umount(cifs_sb);
184}
185
186static void cifs_kill_sb(struct super_block *sb) 169static void cifs_kill_sb(struct super_block *sb)
187{ 170{
188 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 171 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
189 kill_anon_super(sb); 172 kill_anon_super(sb);
173 cifs_umount(cifs_sb);
190 kfree(cifs_sb->mountdata); 174 kfree(cifs_sb->mountdata);
191 unload_nls(cifs_sb->local_nls); 175 unload_nls(cifs_sb->local_nls);
192 kfree(cifs_sb); 176 kfree(cifs_sb);
@@ -537,7 +521,6 @@ static int cifs_drop_inode(struct inode *inode)
537} 521}
538 522
539static const struct super_operations cifs_super_ops = { 523static const struct super_operations cifs_super_ops = {
540 .put_super = cifs_put_super,
541 .statfs = cifs_statfs, 524 .statfs = cifs_statfs,
542 .alloc_inode = cifs_alloc_inode, 525 .alloc_inode = cifs_alloc_inode,
543 .destroy_inode = cifs_destroy_inode, 526 .destroy_inode = cifs_destroy_inode,