diff options
author | Shyam Prasad N <sprasad@microsoft.com> | 2023-10-13 12:25:30 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2023-11-09 19:25:14 +0300 |
commit | 0c51cc6f2cb0108e7d49805f6e089cd85caab279 (patch) | |
tree | ec592e46424ae9d67d938bcd70093e73489e3336 /fs/smb/client/smb2transport.c | |
parent | 1bc081b67a79b6e75fae686e98048cea1038ae31 (diff) | |
download | linux-0c51cc6f2cb0108e7d49805f6e089cd85caab279.tar.xz |
cifs: handle cases where a channel is closed
So far, SMB multichannel could only scale up, but not
scale down the number of channels. In this series of
patch, we now allow the client to deal with the case
of multichannel disabled on the server when the share
is mounted. With that change, we now need the ability
to scale down the channels.
This change allows the client to deal with cases of
missing channels more gracefully.
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/smb2transport.c')
-rw-r--r-- | fs/smb/client/smb2transport.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/smb/client/smb2transport.c b/fs/smb/client/smb2transport.c index 23c50ed7d4b5..84ea67301303 100644 --- a/fs/smb/client/smb2transport.c +++ b/fs/smb/client/smb2transport.c @@ -413,7 +413,13 @@ generate_smb3signingkey(struct cifs_ses *ses, ses->ses_status == SES_GOOD); chan_index = cifs_ses_get_chan_index(ses, server); - /* TODO: introduce ref counting for channels when the can be freed */ + if (chan_index == CIFS_INVAL_CHAN_INDEX) { + spin_unlock(&ses->chan_lock); + spin_unlock(&ses->ses_lock); + + return -EINVAL; + } + spin_unlock(&ses->chan_lock); spin_unlock(&ses->ses_lock); |