From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E806EAD48 for ; Wed, 4 Jan 2023 16:20:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6630BC433D2; Wed, 4 Jan 2023 16:20:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1672849210; bh=gbueyn30KPFSslQhbfJLCwpeIQPsQuHQBcdCpyP6FU4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R24pempimE+SnGpVdVbgCxrwqy3GmdX/S6uXFDTxQddNyUsjrlN/SeT4U0aW8yT/O zPGunsesdM1L+IgMWiuZMnsY/ta+OOKzWR8S2JpN6k+3fujdWIgk713iwDGkZpxjFc aRhc7Q0yyyad+RR/znFqK+nafQyP27RYifuHQVyM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Paulo Alcantara (SUSE)" , Steve French Subject: [PATCH 6.0 083/177] cifs: set correct ipc status after initial tree connect Date: Wed, 4 Jan 2023 17:06:14 +0100 Message-Id: <20230104160510.162714907@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230104160507.635888536@linuxfoundation.org> References: <20230104160507.635888536@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Paulo Alcantara 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 --- fs/cifs/connect.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1870,6 +1870,9 @@ cifs_setup_ipc(struct cifs_ses *ses, str 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 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: