diff options
author | Shyam Prasad N <sprasad@microsoft.com> | 2022-05-31 15:31:05 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-06-07 02:23:38 +0300 |
commit | 8ea21823aa584b55ba4b861307093b78054b0c1b (patch) | |
tree | ad287f65c45d773de7b2e6e07cf39c684db6a1a3 /fs/cifs | |
parent | c36ee7dab7749f7be21f7a72392744490b2a9a2b (diff) | |
download | linux-8ea21823aa584b55ba4b861307093b78054b0c1b.tar.xz |
cifs: return errors during session setup during reconnects
During reconnects, we check the return value from
cifs_negotiate_protocol, and have handlers for both success
and failures. But if that passes, and cifs_setup_session
returns any errors other than -EACCES, we do not handle
that. This fix adds a handler for that, so that we don't
go ahead and try a tree_connect on a failed session.
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/smb2pdu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 0e8c85249579..eaf975f1ad89 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -288,6 +288,9 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon, mutex_unlock(&ses->session_mutex); rc = -EHOSTDOWN; goto failed; + } else if (rc) { + mutex_unlock(&ses->session_mutex); + goto out; } } else { mutex_unlock(&ses->session_mutex); |