diff options
author | Steve French <stfrench@microsoft.com> | 2021-05-07 20:00:41 -0500 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2021-05-08 10:50:53 -0500 |
commit | 9c2dc11df50d1c8537075ff6b98472198e24438e (patch) | |
tree | 68ad663a5a4d6dc5963ff6e1c85dc09705105b3f /fs | |
parent | 679971e7213174efb56abc8fab1299d0a88db0e8 (diff) | |
download | linux-9c2dc11df50d1c8537075ff6b98472198e24438e.tar.bz2 |
smb3: do not attempt multichannel to server which does not support it
We were ignoring CAP_MULTI_CHANNEL in the server response - if the
server doesn't support multichannel we should not be attempting it.
See MS-SMB2 section 3.2.5.2
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-By: Tom Talpey <tom@talpey.com>
Cc: <stable@vger.kernel.org> # v5.8+
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/sess.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 63d517b9f2ff..a92a1fb7cb52 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -97,6 +97,12 @@ int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses) return 0; } + if (!(ses->server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) { + cifs_dbg(VFS, "server %s does not support multichannel\n", ses->server->hostname); + ses->chan_max = 1; + return 0; + } + /* * Make a copy of the iface list at the time and use that * instead so as to not hold the iface spinlock for opening |