diff options
author | Jan Klos <honza.klos@gmail.com> | 2013-10-06 15:08:20 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-10-07 10:54:45 -0400 |
commit | 2f6c9479633780ba4a3484bba7eba5a721a5cf20 (patch) | |
tree | 61a328a909b24d9d25ed61c38a3afd0933a94fe1 /fs | |
parent | eb4c7df6c20b407ecbf1a985edc33d967371c2e8 (diff) |
cifs: Fix inability to write files >2GB to SMB2/3 shares
When connecting to SMB2/3 shares, maximum file size is set to non-LFS maximum in superblock. This is due to cap_large_files bit being different for SMB1 and SMB2/3 (where it is just an internal flag that is not negotiated and the SMB1 one corresponds to multichannel capability, so maybe LFS works correctly if server sends 0x08 flag) while capabilities are checked always for the SMB1 bit in cifs_read_super().
The patch fixes this by checking for the correct bit according to the protocol version.
CC: Stable <stable@kernel.org>
Signed-off-by: Jan Klos <honza.klos@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsfs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index a16b4e58bcc6..77fc5e181077 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -120,14 +120,16 @@ cifs_read_super(struct super_block *sb) | |||
120 | { | 120 | { |
121 | struct inode *inode; | 121 | struct inode *inode; |
122 | struct cifs_sb_info *cifs_sb; | 122 | struct cifs_sb_info *cifs_sb; |
123 | struct cifs_tcon *tcon; | ||
123 | int rc = 0; | 124 | int rc = 0; |
124 | 125 | ||
125 | cifs_sb = CIFS_SB(sb); | 126 | cifs_sb = CIFS_SB(sb); |
127 | tcon = cifs_sb_master_tcon(cifs_sb); | ||
126 | 128 | ||
127 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIXACL) | 129 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIXACL) |
128 | sb->s_flags |= MS_POSIXACL; | 130 | sb->s_flags |= MS_POSIXACL; |
129 | 131 | ||
130 | if (cifs_sb_master_tcon(cifs_sb)->ses->capabilities & CAP_LARGE_FILES) | 132 | if (tcon->ses->capabilities & tcon->ses->server->vals->cap_large_files) |
131 | sb->s_maxbytes = MAX_LFS_FILESIZE; | 133 | sb->s_maxbytes = MAX_LFS_FILESIZE; |
132 | else | 134 | else |
133 | sb->s_maxbytes = MAX_NON_LFS; | 135 | sb->s_maxbytes = MAX_NON_LFS; |
@@ -147,7 +149,7 @@ cifs_read_super(struct super_block *sb) | |||
147 | goto out_no_root; | 149 | goto out_no_root; |
148 | } | 150 | } |
149 | 151 | ||
150 | if (cifs_sb_master_tcon(cifs_sb)->nocase) | 152 | if (tcon->nocase) |
151 | sb->s_d_op = &cifs_ci_dentry_ops; | 153 | sb->s_d_op = &cifs_ci_dentry_ops; |
152 | else | 154 | else |
153 | sb->s_d_op = &cifs_dentry_ops; | 155 | sb->s_d_op = &cifs_dentry_ops; |