diff options
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 2af14d4577a7..4004bc647a72 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -104,8 +104,7 @@ cifs_sb_deactive(struct super_block *sb) | |||
104 | } | 104 | } |
105 | 105 | ||
106 | static int | 106 | static int |
107 | cifs_read_super(struct super_block *sb, struct smb_vol *volume_info, | 107 | cifs_read_super(struct super_block *sb) |
108 | const char *devname, int silent) | ||
109 | { | 108 | { |
110 | struct inode *inode; | 109 | struct inode *inode; |
111 | struct cifs_sb_info *cifs_sb; | 110 | struct cifs_sb_info *cifs_sb; |
@@ -113,14 +112,6 @@ cifs_read_super(struct super_block *sb, struct smb_vol *volume_info, | |||
113 | 112 | ||
114 | cifs_sb = CIFS_SB(sb); | 113 | cifs_sb = CIFS_SB(sb); |
115 | 114 | ||
116 | rc = cifs_mount(cifs_sb, volume_info); | ||
117 | |||
118 | if (rc) { | ||
119 | if (!silent) | ||
120 | cERROR(1, "cifs_mount failed w/return code = %d", rc); | ||
121 | return rc; | ||
122 | } | ||
123 | |||
124 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIXACL) | 115 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIXACL) |
125 | sb->s_flags |= MS_POSIXACL; | 116 | sb->s_flags |= MS_POSIXACL; |
126 | 117 | ||
@@ -692,6 +683,17 @@ cifs_do_mount(struct file_system_type *fs_type, | |||
692 | 683 | ||
693 | cifs_setup_cifs_sb(volume_info, cifs_sb); | 684 | cifs_setup_cifs_sb(volume_info, cifs_sb); |
694 | 685 | ||
686 | rc = cifs_mount(cifs_sb, volume_info); | ||
687 | if (rc) { | ||
688 | if (!(flags & MS_SILENT)) | ||
689 | cERROR(1, "cifs_mount failed w/return code = %d", rc); | ||
690 | root = ERR_PTR(rc); | ||
691 | unload_nls(volume_info->local_nls); | ||
692 | kfree(cifs_sb->mountdata); | ||
693 | kfree(cifs_sb); | ||
694 | goto out; | ||
695 | } | ||
696 | |||
695 | mnt_data.vol = volume_info; | 697 | mnt_data.vol = volume_info; |
696 | mnt_data.cifs_sb = cifs_sb; | 698 | mnt_data.cifs_sb = cifs_sb; |
697 | mnt_data.flags = flags; | 699 | mnt_data.flags = flags; |
@@ -699,11 +701,13 @@ cifs_do_mount(struct file_system_type *fs_type, | |||
699 | sb = sget(fs_type, cifs_match_super, set_anon_super, &mnt_data); | 701 | sb = sget(fs_type, cifs_match_super, set_anon_super, &mnt_data); |
700 | if (IS_ERR(sb)) { | 702 | if (IS_ERR(sb)) { |
701 | root = ERR_CAST(sb); | 703 | root = ERR_CAST(sb); |
704 | cifs_umount(cifs_sb); | ||
702 | goto out_cifs_sb; | 705 | goto out_cifs_sb; |
703 | } | 706 | } |
704 | 707 | ||
705 | if (sb->s_fs_info) { | 708 | if (sb->s_fs_info) { |
706 | cFYI(1, "Use existing superblock"); | 709 | cFYI(1, "Use existing superblock"); |
710 | cifs_umount(cifs_sb); | ||
707 | kfree(cifs_sb->mountdata); | 711 | kfree(cifs_sb->mountdata); |
708 | unload_nls(cifs_sb->local_nls); | 712 | unload_nls(cifs_sb->local_nls); |
709 | kfree(cifs_sb); | 713 | kfree(cifs_sb); |
@@ -715,8 +719,7 @@ cifs_do_mount(struct file_system_type *fs_type, | |||
715 | sb->s_flags |= MS_NODIRATIME | MS_NOATIME; | 719 | sb->s_flags |= MS_NODIRATIME | MS_NOATIME; |
716 | sb->s_fs_info = cifs_sb; | 720 | sb->s_fs_info = cifs_sb; |
717 | 721 | ||
718 | rc = cifs_read_super(sb, volume_info, dev_name, | 722 | rc = cifs_read_super(sb); |
719 | flags & MS_SILENT ? 1 : 0); | ||
720 | if (rc) { | 723 | if (rc) { |
721 | root = ERR_PTR(rc); | 724 | root = ERR_PTR(rc); |
722 | goto out_super; | 725 | goto out_super; |