smb3: fix incorrect session setup check for multiuser mounts 5.17-rc8-smb3-fix
authorSteve French <stfrench@microsoft.com>
Thu, 17 Mar 2022 03:08:43 +0000 (22:08 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 17 Mar 2022 03:48:55 +0000 (22:48 -0500)
A recent change to how the SMB3 server (socket) and session status
is managed regressed multiuser mounts by changing the check
for whether session setup is needed to the socket (TCP_Server_info)
structure instead of the session struct (cifs_ses). Add additional
check in cifs_setup_sesion to fix this.

Fixes: 73f9bfbe3d81 ("cifs: maintain a state machine for tcp/smb/tcon sessions")
Reported-by: Ronnie Sahlberg <lsahlber@redhat.com>
Acked-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/connect.c

index 053cb449eb167ec415ba13dc3e5cfb97fa4e6428..d3020abfe404ae82b9dd162c9d9cb12a2070cd1a 100644 (file)
@@ -3924,7 +3924,8 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
 
        /* only send once per connect */
        spin_lock(&cifs_tcp_ses_lock);
-       if (server->tcpStatus != CifsNeedSessSetup) {
+       if ((server->tcpStatus != CifsNeedSessSetup) &&
+           (ses->status == CifsGood)) {
                spin_unlock(&cifs_tcp_ses_lock);
                return 0;
        }