cifs: set correct tcon status after initial tree connect
authorPaulo Alcantara <pc@cjr.nz>
Tue, 13 Dec 2022 12:15:23 +0000 (09:15 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 10:11:50 +0000 (11:11 +0100)
commit b248586a49a7729f73c504b1e7b958caea45e927 upstream.

cifs_tcon::status wasn't correctly updated to TID_GOOD after initial
tree connect thus staying at TID_NEW as long as it was connected.

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>
fs/cifs/connect.c

index ede655d..191fc13 100644 (file)
@@ -2602,6 +2602,7 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx)
        tcon->nodelete = ctx->nodelete;
        tcon->local_lease = ctx->local_lease;
        INIT_LIST_HEAD(&tcon->pending_opens);
+       tcon->status = TID_GOOD;
 
        /* schedule query interfaces poll */
        INIT_DELAYED_WORK(&tcon->query_interfaces,