]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
cifs: return errors during session setup during reconnects
authorShyam Prasad N <sprasad@microsoft.com>
Tue, 31 May 2022 12:31:05 +0000 (12:31 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:32:45 +0000 (18:32 +0200)
commit 8ea21823aa584b55ba4b861307093b78054b0c1b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2pdu.c

index 88554b640b0da9f4b98b092f3c45c078c0a3327d..24dd711fa9b958caa52b82fcd4801e5457f78b76 100644 (file)
@@ -281,6 +281,9 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
                        ses->binding_chan = NULL;
                        mutex_unlock(&tcon->ses->session_mutex);
                        goto failed;
+               } else if (rc) {
+                       mutex_unlock(&ses->session_mutex);
+                       goto out;
                }
        }
        /*