aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Alcantara2022-12-16 14:00:19 -0300
committerSteve French2022-12-16 13:18:25 -0600
commit86fe0fa8747fb1bc4cc44fc1966e0959fe752f38 (patch)
tree16f79fb94e067a366221e95235cf1badf6c2443a
parentb248586a49a7729f73c504b1e7b958caea45e927 (diff)
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: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r--fs/cifs/connect.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index eda75c99a0f5..f51715d3e2f2 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1871,6 +1871,9 @@ cifs_setup_ipc(struct cifs_ses *ses, struct smb3_fs_context *ctx)
cifs_dbg(FYI, "IPC tcon rc=%d ipc tid=0x%x\n", rc, tcon->tid);
+ spin_lock(&tcon->tc_lock);
+ tcon->status = TID_GOOD;
+ spin_unlock(&tcon->tc_lock);
ses->tcon_ipc = tcon;
out:
return rc;
@@ -2278,10 +2281,10 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx)
list_add(&ses->smb_ses_list, &server->smb_ses_list);
spin_unlock(&cifs_tcp_ses_lock);
- free_xid(xid);
-
cifs_setup_ipc(ses, ctx);
+ free_xid(xid);
+
return ses;
get_ses_fail: