aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-06-17 09:05:48 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-06-24 18:39:41 -0400
commit2c6292ae4be00454882246d07f38cdf15a823c2a (patch)
tree40bfa681a0f94f6df2b3f8140452f0eab7809b1c /fs/cifs/cifsfs.c
parentca171baaad1420a29cca98be5bdf5596cd70b294 (diff)
cifs: don't pass superblock to cifs_mount()
To close sget() races we'll need to be able to set cifs_sb up before we get the superblock, so we'll want to be able to do cifs_mount() earlier. Fortunately, it's easy to do - setting ->s_maxbytes can be done in cifs_read_super(), ditto for ->s_time_gran and as for putting MS_POSIXACL into ->s_flags, we can mirror it in ->mnt_cifs_flags until cifs_read_super() is called. Kill unused 'devname' argument, while we are at it... 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/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index bfab2bc83726..8f7451f3c8e6 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -116,7 +116,7 @@ cifs_read_super(struct super_block *sb, struct smb_vol *volume_info,
116 spin_lock_init(&cifs_sb->tlink_tree_lock); 116 spin_lock_init(&cifs_sb->tlink_tree_lock);
117 cifs_sb->tlink_tree = RB_ROOT; 117 cifs_sb->tlink_tree = RB_ROOT;
118 118
119 rc = cifs_mount(sb, cifs_sb, volume_info, devname); 119 rc = cifs_mount(cifs_sb, volume_info);
120 120
121 if (rc) { 121 if (rc) {
122 if (!silent) 122 if (!silent)
@@ -124,6 +124,17 @@ cifs_read_super(struct super_block *sb, struct smb_vol *volume_info,
124 return rc; 124 return rc;
125 } 125 }
126 126
127 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIXACL)
128 sb->s_flags |= MS_POSIXACL;
129
130 if (cifs_sb_master_tcon(cifs_sb)->ses->capabilities & CAP_LARGE_FILES)
131 sb->s_maxbytes = MAX_LFS_FILESIZE;
132 else
133 sb->s_maxbytes = MAX_NON_LFS;
134
135 /* BB FIXME fix time_gran to be larger for LANMAN sessions */
136 sb->s_time_gran = 100;
137
127 sb->s_magic = CIFS_MAGIC_NUMBER; 138 sb->s_magic = CIFS_MAGIC_NUMBER;
128 sb->s_op = &cifs_super_ops; 139 sb->s_op = &cifs_super_ops;
129 sb->s_bdi = &cifs_sb->bdi; 140 sb->s_bdi = &cifs_sb->bdi;