aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2011-02-24 13:07:19 -0500
committerSteve French <sfrench@us.ibm.com>2011-05-19 10:10:50 -0400
commit1cb06d0b50536af177b2f2f7cab25546f3731d3e (patch)
treec0fc587667f9b97d15ff13abbb0efeeba4faf0e7 /fs/cifs
parent257fb1f15d72f89dad2d72fa467c189f2d7fdd71 (diff)
Introduce smb2 mounts as vers=2
As with Linux nfs client, which uses "nfsvers=" or "vers=" to indicate which protocol to use for mount, specifying "vers=smb2" or "vers=2" will force an smb2 mount. When vers is not specified cifs is used ie "vers=cifs" or "vers=1" We can eventually autonegotiate down from smb2 to cifs when smb2 is stable enough to make it the default, but this is for the future. At that time we could also implement a "maxprotocol" mount option as smbclient and Samba have today, but that would be premature until smb2 is stable. Intially the smb2 Kconfig option will depend on "BROKEN" until the merge is complete, and then be "EXPERIMENTAL" When it is no longer experimental we can consider changing the default protocol to attempt first. Reviewed-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/connect.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 8d72acbd5c13..acd1e3c887e1 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -102,6 +102,7 @@ struct smb_vol {
102 bool fsc:1; /* enable fscache */ 102 bool fsc:1; /* enable fscache */
103 bool mfsymlinks:1; /* use Minshall+French Symlinks */ 103 bool mfsymlinks:1; /* use Minshall+French Symlinks */
104 bool multiuser:1; 104 bool multiuser:1;
105 bool use_smb2:1; /* force smb2 use on mount instead of cifs */
105 unsigned int rsize; 106 unsigned int rsize;
106 unsigned int wsize; 107 unsigned int wsize;
107 bool sockopt_tcp_nodelay:1; 108 bool sockopt_tcp_nodelay:1;
@@ -1038,6 +1039,22 @@ cifs_parse_mount_options(char *options, const char *devname,
1038 cERROR(1, "bad security option: %s", value); 1039 cERROR(1, "bad security option: %s", value);
1039 return 1; 1040 return 1;
1040 } 1041 }
1042 } else if (strnicmp(data, "vers", 3) == 0) {
1043 if (!value || !*value) {
1044 cERROR(1, "no protocol version specified"
1045 " after vers= mount option");
1046 } else if ((strnicmp(value, "cifs", 4) == 0) ||
1047 (strnicmp(value, "1", 1) == 0)) {
1048 /* this is the default */
1049 continue;
1050 } else if ((strnicmp(value, "smb2", 4) == 0) ||
1051 (strnicmp(value, "2", 1) == 0)) {
1052#ifdef CONFIG_CIFS_SMB2
1053 vol->use_smb2 = true;
1054#else
1055 cERROR(1, "smb2 support not enabled");
1056#endif /* CONFIG_CIFS_SMB2 */
1057 }
1041 } else if ((strnicmp(data, "unc", 3) == 0) 1058 } else if ((strnicmp(data, "unc", 3) == 0)
1042 || (strnicmp(data, "target", 6) == 0) 1059 || (strnicmp(data, "target", 6) == 0)
1043 || (strnicmp(data, "path", 4) == 0)) { 1060 || (strnicmp(data, "path", 4) == 0)) {