]> Pileus Git - ~andy/linux/commitdiff
Add SMB3.02 dialect support
authorSteve French <smfrench@gmail.com>
Thu, 13 Jun 2013 03:48:41 +0000 (22:48 -0500)
committerSteve French <smfrench@gmail.com>
Mon, 24 Jun 2013 06:56:45 +0000 (01:56 -0500)
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>
fs/cifs/cifsglob.h
fs/cifs/connect.c
fs/cifs/smb2ops.c
fs/cifs/smb2pdu.c
fs/cifs/smb2pdu.h

index c3162c2f95503743289f56f92486dc9a431891c8..f13cbbeaf0982eb1aeb983bdad8e3ef3ad4d80f0 100644 (file)
@@ -175,6 +175,7 @@ enum smb_version {
        Smb_20,
        Smb_21,
        Smb_30,
+       Smb_302,
 };
 
 struct mid_q_entry;
@@ -1486,4 +1487,7 @@ extern struct smb_version_values smb21_values;
 #define SMB30_VERSION_STRING   "3.0"
 extern struct smb_version_operations smb30_operations;
 extern struct smb_version_values smb30_values;
+#define SMB302_VERSION_STRING  "3.02"
+/*extern struct smb_version_operations smb302_operations;*/ /* not needed yet */
+extern struct smb_version_values smb302_values;
 #endif /* _CIFS_GLOB_H */
index c4c6aa99ee1cbaafe52e44a2a6aae7cb4f0f1ba5..d5f866afe560c39e5e7c7f5fb64e910dec3b33dd 100644 (file)
@@ -276,6 +276,7 @@ static const match_table_t cifs_smb_version_tokens = {
        { Smb_20, SMB20_VERSION_STRING},
        { Smb_21, SMB21_VERSION_STRING },
        { Smb_30, SMB30_VERSION_STRING },
+       { Smb_302, SMB302_VERSION_STRING },
 };
 
 static int ip_connect(struct TCP_Server_Info *server);
@@ -1124,6 +1125,10 @@ cifs_parse_smb_version(char *value, struct smb_vol *vol)
                vol->ops = &smb30_operations;
                vol->vals = &smb30_values;
                break;
+       case Smb_302:
+               vol->ops = &smb30_operations; /* currently identical with 3.0 */
+               vol->vals = &smb302_values;
+               break;
 #endif
        default:
                cifs_dbg(VFS, "Unknown vers= option specified: %s\n", value);
index f2e76f3b0c6166aeb345d5a02a0f4bdde5b84731..14539c71e6e66d7a068e0c8565b411fa3c384c16 100644 (file)
@@ -746,3 +746,21 @@ struct smb_version_values smb30_values = {
        .cap_large_files = SMB2_LARGE_FILES,
        .oplock_read = SMB2_OPLOCK_LEVEL_II,
 };
+
+struct smb_version_values smb302_values = {
+       .version_string = SMB302_VERSION_STRING,
+       .protocol_id = SMB302_PROT_ID,
+       .req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU,
+       .large_lock_type = 0,
+       .exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
+       .shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
+       .unlock_lock_type = SMB2_LOCKFLAG_UNLOCK,
+       .header_size = sizeof(struct smb2_hdr),
+       .max_header_size = MAX_SMB2_HDR_SIZE,
+       .read_rsp_size = sizeof(struct smb2_read_rsp) - 1,
+       .lock_cmd = SMB2_LOCK,
+       .cap_unix = 0,
+       .cap_nt_find = SMB2_NT_FIND,
+       .cap_large_files = SMB2_LARGE_FILES,
+       .oplock_read = SMB2_OPLOCK_LEVEL_II,
+};
index a20a8a7e1470ecbc1d0d43ca946516f3b19bca69..cb155bfb3411c4126df6be7909ff059d4e603e02 100644 (file)
@@ -386,6 +386,8 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
                cifs_dbg(FYI, "negotiated smb2.1 dialect\n");
        else if (rsp->DialectRevision == cpu_to_le16(SMB30_PROT_ID))
                cifs_dbg(FYI, "negotiated smb3.0 dialect\n");
+       else if (rsp->DialectRevision == cpu_to_le16(SMB302_PROT_ID))
+               cifs_dbg(FYI, "negotiated smb3.02 dialect\n");
        else {
                cifs_dbg(VFS, "Illegal dialect returned by server %d\n",
                         le16_to_cpu(rsp->DialectRevision));
index 4cb4ced258cb333d326e9fc5ccd353313ec0c8d4..3da33da8123cedb763c6dc6cf0e7b454f32116dc 100644 (file)
@@ -170,6 +170,7 @@ struct smb2_negotiate_req {
 #define SMB20_PROT_ID 0x0202
 #define SMB21_PROT_ID 0x0210
 #define SMB30_PROT_ID 0x0300
+#define SMB302_PROT_ID 0x0302
 #define BAD_PROT_ID   0xFFFF
 
 /* SecurityMode flags */