diff options
author | Steve French <smfrench@gmail.com> | 2013-06-12 23:48:41 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-06-24 02:56:45 -0400 |
commit | 20b6d8b42e7e7c9af5046fe525d6709e10d14992 (patch) | |
tree | 116001ee65e9688793a8fe2b96502e456c54dd3b /fs | |
parent | 9cd2e62c4952a00543685c6ee21cd2bf69b621e9 (diff) |
Add SMB3.02 dialect support
The new Windows update supports SMB3.02 dialect, a minor update to SMB3.
This patch adds support for mounting with vers=3.02
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsglob.h | 4 | ||||
-rw-r--r-- | fs/cifs/connect.c | 5 | ||||
-rw-r--r-- | fs/cifs/smb2ops.c | 18 | ||||
-rw-r--r-- | fs/cifs/smb2pdu.c | 2 | ||||
-rw-r--r-- | fs/cifs/smb2pdu.h | 1 |
5 files changed, 30 insertions, 0 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index c3162c2f9550..f13cbbeaf098 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -175,6 +175,7 @@ enum smb_version { | |||
175 | Smb_20, | 175 | Smb_20, |
176 | Smb_21, | 176 | Smb_21, |
177 | Smb_30, | 177 | Smb_30, |
178 | Smb_302, | ||
178 | }; | 179 | }; |
179 | 180 | ||
180 | struct mid_q_entry; | 181 | struct mid_q_entry; |
@@ -1486,4 +1487,7 @@ extern struct smb_version_values smb21_values; | |||
1486 | #define SMB30_VERSION_STRING "3.0" | 1487 | #define SMB30_VERSION_STRING "3.0" |
1487 | extern struct smb_version_operations smb30_operations; | 1488 | extern struct smb_version_operations smb30_operations; |
1488 | extern struct smb_version_values smb30_values; | 1489 | extern struct smb_version_values smb30_values; |
1490 | #define SMB302_VERSION_STRING "3.02" | ||
1491 | /*extern struct smb_version_operations smb302_operations;*/ /* not needed yet */ | ||
1492 | extern struct smb_version_values smb302_values; | ||
1489 | #endif /* _CIFS_GLOB_H */ | 1493 | #endif /* _CIFS_GLOB_H */ |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index c4c6aa99ee1c..d5f866afe560 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -276,6 +276,7 @@ static const match_table_t cifs_smb_version_tokens = { | |||
276 | { Smb_20, SMB20_VERSION_STRING}, | 276 | { Smb_20, SMB20_VERSION_STRING}, |
277 | { Smb_21, SMB21_VERSION_STRING }, | 277 | { Smb_21, SMB21_VERSION_STRING }, |
278 | { Smb_30, SMB30_VERSION_STRING }, | 278 | { Smb_30, SMB30_VERSION_STRING }, |
279 | { Smb_302, SMB302_VERSION_STRING }, | ||
279 | }; | 280 | }; |
280 | 281 | ||
281 | static int ip_connect(struct TCP_Server_Info *server); | 282 | static int ip_connect(struct TCP_Server_Info *server); |
@@ -1124,6 +1125,10 @@ cifs_parse_smb_version(char *value, struct smb_vol *vol) | |||
1124 | vol->ops = &smb30_operations; | 1125 | vol->ops = &smb30_operations; |
1125 | vol->vals = &smb30_values; | 1126 | vol->vals = &smb30_values; |
1126 | break; | 1127 | break; |
1128 | case Smb_302: | ||
1129 | vol->ops = &smb30_operations; /* currently identical with 3.0 */ | ||
1130 | vol->vals = &smb302_values; | ||
1131 | break; | ||
1127 | #endif | 1132 | #endif |
1128 | default: | 1133 | default: |
1129 | cifs_dbg(VFS, "Unknown vers= option specified: %s\n", value); | 1134 | cifs_dbg(VFS, "Unknown vers= option specified: %s\n", value); |
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index f2e76f3b0c61..14539c71e6e6 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
@@ -746,3 +746,21 @@ struct smb_version_values smb30_values = { | |||
746 | .cap_large_files = SMB2_LARGE_FILES, | 746 | .cap_large_files = SMB2_LARGE_FILES, |
747 | .oplock_read = SMB2_OPLOCK_LEVEL_II, | 747 | .oplock_read = SMB2_OPLOCK_LEVEL_II, |
748 | }; | 748 | }; |
749 | |||
750 | struct smb_version_values smb302_values = { | ||
751 | .version_string = SMB302_VERSION_STRING, | ||
752 | .protocol_id = SMB302_PROT_ID, | ||
753 | .req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU, | ||
754 | .large_lock_type = 0, | ||
755 | .exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK, | ||
756 | .shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK, | ||
757 | .unlock_lock_type = SMB2_LOCKFLAG_UNLOCK, | ||
758 | .header_size = sizeof(struct smb2_hdr), | ||
759 | .max_header_size = MAX_SMB2_HDR_SIZE, | ||
760 | .read_rsp_size = sizeof(struct smb2_read_rsp) - 1, | ||
761 | .lock_cmd = SMB2_LOCK, | ||
762 | .cap_unix = 0, | ||
763 | .cap_nt_find = SMB2_NT_FIND, | ||
764 | .cap_large_files = SMB2_LARGE_FILES, | ||
765 | .oplock_read = SMB2_OPLOCK_LEVEL_II, | ||
766 | }; | ||
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index a20a8a7e1470..cb155bfb3411 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c | |||
@@ -386,6 +386,8 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) | |||
386 | cifs_dbg(FYI, "negotiated smb2.1 dialect\n"); | 386 | cifs_dbg(FYI, "negotiated smb2.1 dialect\n"); |
387 | else if (rsp->DialectRevision == cpu_to_le16(SMB30_PROT_ID)) | 387 | else if (rsp->DialectRevision == cpu_to_le16(SMB30_PROT_ID)) |
388 | cifs_dbg(FYI, "negotiated smb3.0 dialect\n"); | 388 | cifs_dbg(FYI, "negotiated smb3.0 dialect\n"); |
389 | else if (rsp->DialectRevision == cpu_to_le16(SMB302_PROT_ID)) | ||
390 | cifs_dbg(FYI, "negotiated smb3.02 dialect\n"); | ||
389 | else { | 391 | else { |
390 | cifs_dbg(VFS, "Illegal dialect returned by server %d\n", | 392 | cifs_dbg(VFS, "Illegal dialect returned by server %d\n", |
391 | le16_to_cpu(rsp->DialectRevision)); | 393 | le16_to_cpu(rsp->DialectRevision)); |
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index 4cb4ced258cb..3da33da8123c 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h | |||
@@ -170,6 +170,7 @@ struct smb2_negotiate_req { | |||
170 | #define SMB20_PROT_ID 0x0202 | 170 | #define SMB20_PROT_ID 0x0202 |
171 | #define SMB21_PROT_ID 0x0210 | 171 | #define SMB21_PROT_ID 0x0210 |
172 | #define SMB30_PROT_ID 0x0300 | 172 | #define SMB30_PROT_ID 0x0300 |
173 | #define SMB302_PROT_ID 0x0302 | ||
173 | #define BAD_PROT_ID 0xFFFF | 174 | #define BAD_PROT_ID 0xFFFF |
174 | 175 | ||
175 | /* SecurityMode flags */ | 176 | /* SecurityMode flags */ |