Skip to content

Commit 86fe0fa

Browse files
Paulo Alcantarasmfrench
authored andcommitted
cifs: set correct ipc status after initial tree connect
cifs_tcon::status wasn't correctly updated to TID_GOOD after establishing initial IPC connection thus staying at TID_NEW as long as it wasn't reconnected. Cc: [email protected] Signed-off-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent b248586 commit 86fe0fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/cifs/connect.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,9 @@ cifs_setup_ipc(struct cifs_ses *ses, struct smb3_fs_context *ctx)
18711871

18721872
cifs_dbg(FYI, "IPC tcon rc=%d ipc tid=0x%x\n", rc, tcon->tid);
18731873

1874+
spin_lock(&tcon->tc_lock);
1875+
tcon->status = TID_GOOD;
1876+
spin_unlock(&tcon->tc_lock);
18741877
ses->tcon_ipc = tcon;
18751878
out:
18761879
return rc;
@@ -2278,10 +2281,10 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx)
22782281
list_add(&ses->smb_ses_list, &server->smb_ses_list);
22792282
spin_unlock(&cifs_tcp_ses_lock);
22802283

2281-
free_xid(xid);
2282-
22832284
cifs_setup_ipc(ses, ctx);
22842285

2286+
free_xid(xid);
2287+
22852288
return ses;
22862289

22872290
get_ses_fail:

0 commit comments

Comments
 (0)