Skip to content

Commit 0a55a1f

Browse files
committed
Merge tag '5.13-rc-smb3-part3' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs fixes from Steve French: "Three small SMB3 chmultichannel related changesets (also for stable) from the SMB3 test event this week. The other fixes are still in review/testing" * tag '5.13-rc-smb3-part3' of git://git.samba.org/sfrench/cifs-2.6: smb3: if max_channels set to more than one channel request multichannel smb3: do not attempt multichannel to server which does not support it smb3: when mounting with multichannel include it in requested capabilities
2 parents 9819f68 + c1f8a39 commit 0a55a1f

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

fs/cifs/fs_context.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,9 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
10211021
goto cifs_parse_mount_err;
10221022
}
10231023
ctx->max_channels = result.uint_32;
1024+
/* If more than one channel requested ... they want multichan */
1025+
if (result.uint_32 > 1)
1026+
ctx->multichannel = true;
10241027
break;
10251028
case Opt_handletimeout:
10261029
ctx->handle_timeout = result.uint_32;

fs/cifs/sess.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
9797
return 0;
9898
}
9999

100+
if (!(ses->server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) {
101+
cifs_dbg(VFS, "server %s does not support multichannel\n", ses->server->hostname);
102+
ses->chan_max = 1;
103+
return 0;
104+
}
105+
100106
/*
101107
* Make a copy of the iface list at the time and use that
102108
* instead so as to not hold the iface spinlock for opening

fs/cifs/smb2pdu.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,8 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
841841
req->SecurityMode = 0;
842842

843843
req->Capabilities = cpu_to_le32(server->vals->req_capabilities);
844+
if (ses->chan_max > 1)
845+
req->Capabilities |= cpu_to_le32(SMB2_GLOBAL_CAP_MULTI_CHANNEL);
844846

845847
/* ClientGUID must be zero for SMB2.02 dialect */
846848
if (server->vals->protocol_id == SMB20_PROT_ID)
@@ -1032,6 +1034,9 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)
10321034

10331035
pneg_inbuf->Capabilities =
10341036
cpu_to_le32(server->vals->req_capabilities);
1037+
if (tcon->ses->chan_max > 1)
1038+
pneg_inbuf->Capabilities |= cpu_to_le32(SMB2_GLOBAL_CAP_MULTI_CHANNEL);
1039+
10351040
memcpy(pneg_inbuf->Guid, server->client_guid,
10361041
SMB2_CLIENT_GUID_SIZE);
10371042

0 commit comments

Comments
 (0)