Commit 98ab494d authored by Al Viro's avatar Al Viro

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: default avatarPavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 97d1152a
...@@ -163,30 +163,14 @@ cifs_read_super(struct super_block *sb) ...@@ -163,30 +163,14 @@ cifs_read_super(struct super_block *sb)
if (inode) if (inode)
iput(inode); iput(inode);
cifs_umount(cifs_sb);
return rc; return rc;
} }
static void
cifs_put_super(struct super_block *sb)
{
int rc = 0;
struct cifs_sb_info *cifs_sb;
cFYI(1, "In cifs_put_super");
cifs_sb = CIFS_SB(sb);
if (cifs_sb == NULL) {
cFYI(1, "Empty cifs superblock info passed to unmount");
return;
}
cifs_umount(cifs_sb);
}
static void cifs_kill_sb(struct super_block *sb) static void cifs_kill_sb(struct super_block *sb)
{ {
struct cifs_sb_info *cifs_sb = CIFS_SB(sb); struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
kill_anon_super(sb); kill_anon_super(sb);
cifs_umount(cifs_sb);
kfree(cifs_sb->mountdata); kfree(cifs_sb->mountdata);
unload_nls(cifs_sb->local_nls); unload_nls(cifs_sb->local_nls);
kfree(cifs_sb); kfree(cifs_sb);
...@@ -537,7 +521,6 @@ static int cifs_drop_inode(struct inode *inode) ...@@ -537,7 +521,6 @@ static int cifs_drop_inode(struct inode *inode)
} }
static const struct super_operations cifs_super_ops = { static const struct super_operations cifs_super_ops = {
.put_super = cifs_put_super,
.statfs = cifs_statfs, .statfs = cifs_statfs,
.alloc_inode = cifs_alloc_inode, .alloc_inode = cifs_alloc_inode,
.destroy_inode = cifs_destroy_inode, .destroy_inode = cifs_destroy_inode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment