Skip to content

Commit

Permalink
smb3: fix incorrect session setup check for multiuser mounts
Browse files Browse the repository at this point in the history
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: 73f9bfb ("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>
  • Loading branch information
Steve French committed Mar 17, 2022
1 parent 09688c0 commit e3ee9fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e3ee9fb

Please sign in to comment.