Skip to content

Commit

Permalink
cifs: set correct ipc status after initial tree connect
Browse files Browse the repository at this point in the history
commit 86fe0fa 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) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
pcacjr authored and gregkh committed Jan 7, 2023
1 parent 2d8cbc1 commit a37d718
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fs/cifs/connect.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit a37d718

Please sign in to comment.