From: Paulo Alcantara Date: Fri, 16 Dec 2022 17:00:19 +0000 (-0300) Subject: cifs: set correct ipc status after initial tree connect X-Git-Tag: v6.1.8~644 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a37d718a0e0b1d3417c3d0098399266cb6d02ef8;p=platform%2Fkernel%2Flinux-starfive.git cifs: set correct ipc status after initial tree connect commit 86fe0fa8747fb1bc4cc44fc1966e0959fe752f38 upstream. 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) Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 191fc13..0d0e173 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; @@ -2280,10 +2283,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: