@@ -241,7 +241,7 @@ cifs_mark_tcp_ses_conns_for_reconnect(struct TCP_Server_Info *server,
241241 if (!mark_smb_session && !CIFS_ALL_CHANS_NEED_RECONNECT (ses ))
242242 goto next_session ;
243243
244- ses -> status = CifsNeedReconnect ;
244+ ses -> ses_status = SES_NEED_RECON ;
245245
246246 list_for_each_entry (tcon , & ses -> tcon_list , tcon_list ) {
247247 tcon -> need_reconnect = true;
@@ -1828,7 +1828,7 @@ cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx)
18281828
18291829 spin_lock (& cifs_tcp_ses_lock );
18301830 list_for_each_entry (ses , & server -> smb_ses_list , smb_ses_list ) {
1831- if (ses -> status == CifsExiting )
1831+ if (ses -> ses_status == SES_EXITING )
18321832 continue ;
18331833 if (!match_session (ses , ctx ))
18341834 continue ;
@@ -1848,7 +1848,7 @@ void cifs_put_smb_ses(struct cifs_ses *ses)
18481848 cifs_dbg (FYI , "%s: ses_count=%d\n" , __func__ , ses -> ses_count );
18491849
18501850 spin_lock (& cifs_tcp_ses_lock );
1851- if (ses -> status == CifsExiting ) {
1851+ if (ses -> ses_status == SES_EXITING ) {
18521852 spin_unlock (& cifs_tcp_ses_lock );
18531853 return ;
18541854 }
@@ -1864,13 +1864,13 @@ void cifs_put_smb_ses(struct cifs_ses *ses)
18641864 /* ses_count can never go negative */
18651865 WARN_ON (ses -> ses_count < 0 );
18661866
1867- if (ses -> status == CifsGood )
1868- ses -> status = CifsExiting ;
1867+ if (ses -> ses_status == SES_GOOD )
1868+ ses -> ses_status = SES_EXITING ;
18691869 spin_unlock (& cifs_tcp_ses_lock );
18701870
18711871 cifs_free_ipc (ses );
18721872
1873- if (ses -> status == CifsExiting && server -> ops -> logoff ) {
1873+ if (ses -> ses_status == SES_EXITING && server -> ops -> logoff ) {
18741874 xid = get_xid ();
18751875 rc = server -> ops -> logoff (xid , ses );
18761876 if (rc )
@@ -2090,7 +2090,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx)
20902090 ses = cifs_find_smb_ses (server , ctx );
20912091 if (ses ) {
20922092 cifs_dbg (FYI , "Existing smb sess found (status=%d)\n" ,
2093- ses -> status );
2093+ ses -> ses_status );
20942094
20952095 spin_lock (& ses -> chan_lock );
20962096 if (cifs_chan_needs_reconnect (ses , server )) {
@@ -4001,11 +4001,13 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
40014001 spin_unlock (& ses -> chan_lock );
40024002
40034003 spin_lock (& cifs_tcp_ses_lock );
4004- if (ses -> status == CifsExiting ) {
4004+ if (ses -> ses_status == SES_EXITING ) {
40054005 spin_unlock (& cifs_tcp_ses_lock );
40064006 return 0 ;
40074007 }
4008- ses -> status = CifsInSessSetup ;
4008+
4009+ if (!is_binding )
4010+ ses -> ses_status = SES_IN_SETUP ;
40094011 spin_unlock (& cifs_tcp_ses_lock );
40104012
40114013 if (!is_binding ) {
@@ -4031,15 +4033,13 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
40314033 if (rc ) {
40324034 cifs_server_dbg (VFS , "Send error in SessSetup = %d\n" , rc );
40334035 spin_lock (& cifs_tcp_ses_lock );
4034- if (ses -> status == CifsInSessSetup )
4035- ses -> status = CifsNeedSessSetup ;
4036+ if (ses -> ses_status == SES_IN_SETUP )
4037+ ses -> ses_status = SES_NEED_RECON ;
40364038 spin_unlock (& cifs_tcp_ses_lock );
40374039 } else {
40384040 spin_lock (& cifs_tcp_ses_lock );
4039- if (ses -> status == CifsInSessSetup )
4040- ses -> status = CifsGood ;
4041- /* Even if one channel is active, session is in good state */
4042- ses -> status = CifsGood ;
4041+ if (ses -> ses_status == SES_IN_SETUP )
4042+ ses -> ses_status = SES_GOOD ;
40434043 spin_unlock (& cifs_tcp_ses_lock );
40444044
40454045 spin_lock (& ses -> chan_lock );
@@ -4509,7 +4509,7 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru
45094509
45104510 /* only send once per connect */
45114511 spin_lock (& cifs_tcp_ses_lock );
4512- if (tcon -> ses -> status != CifsGood ||
4512+ if (tcon -> ses -> ses_status != SES_GOOD ||
45134513 (tcon -> status != TID_NEW &&
45144514 tcon -> status != TID_NEED_TCON )) {
45154515 spin_unlock (& cifs_tcp_ses_lock );
@@ -4577,7 +4577,7 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru
45774577
45784578 /* only send once per connect */
45794579 spin_lock (& cifs_tcp_ses_lock );
4580- if (tcon -> ses -> status != CifsGood ||
4580+ if (tcon -> ses -> ses_status != SES_GOOD ||
45814581 (tcon -> status != TID_NEW &&
45824582 tcon -> status != TID_NEED_TCON )) {
45834583 spin_unlock (& cifs_tcp_ses_lock );
0 commit comments