]> git.ipfire.org Git - thirdparty/linux.git/commit
cifs: handle servers that still advertise multichannel after disabling
authorShyam Prasad N <sprasad@microsoft.com>
Tue, 2 Jan 2024 13:14:46 +0000 (13:14 +0000)
committerSteve French <stfrench@microsoft.com>
Fri, 19 Jan 2024 16:33:17 +0000 (10:33 -0600)
commitf591062bdbf4742b7f1622173017f19e927057b0
treebf9bb7475e7d761d12cc670b86f3157027e2165f
parentce09f8d8a7130e6edfdd6fcad8eb277824d5de95
cifs: handle servers that still advertise multichannel after disabling

Some servers like Azure SMB servers always advertise multichannel
capability in server capabilities list. Such servers return error
STATUS_NOT_IMPLEMENTED for ioctl calls to query server interfaces,
and expect clients to consider that as a sign that they do not support
multichannel.

We already handled this at mount time. Soon after the tree connect,
we query server interfaces. And when server returned STATUS_NOT_IMPLEMENTED,
we kept interface list as empty. When cifs_try_adding_channels gets
called, it would not find any interfaces, so will not add channels.

For the case where an active multichannel mount exists, and multichannel
is disabled by such a server, this change will now allow the client
to disable secondary channels on the mount. It will check the return
status of query server interfaces call soon after a tree reconnect.
If the return status is EOPNOTSUPP, then instead of the check to add
more channels, we'll disable the secondary channels instead.

For better code reuse, this change also moves the common code for
disabling multichannel to a helper function.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2ops.c
fs/smb/client/smb2pdu.c