Skip to content

Commit

Permalink
cifs: update tcpStatus during negotiate and sess setup
Browse files Browse the repository at this point in the history
Till the end of SMB session setup, update tcpStatus and
avoid updating session status field. There was a typo in
cifs_setup_session, which caused ses->status to be updated
instead. This was causing issues during reconnect.

Signed-off-by: Shyam Prasad N <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
sprasad-microsoft authored and Steve French committed Jan 19, 2022
1 parent c1604da commit 47de760
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -3908,7 +3908,7 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
spin_unlock(&cifs_tcp_ses_lock);
return 0;
}
ses->status = CifsInSessSetup;
server->tcpStatus = CifsInSessSetup;
spin_unlock(&cifs_tcp_ses_lock);

spin_lock(&ses->chan_lock);
Expand Down Expand Up @@ -3946,8 +3946,7 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
if (server->tcpStatus == CifsInSessSetup)
server->tcpStatus = CifsGood;
/* Even if one channel is active, session is in good state */
if (ses->status == CifsInSessSetup)
ses->status = CifsGood;
ses->status = CifsGood;
spin_unlock(&cifs_tcp_ses_lock);

spin_lock(&ses->chan_lock);
Expand Down

0 comments on commit 47de760

Please sign in to comment.