linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][SMB3 client] Two reconnect patches
@ 2022-12-17 15:16 Steve French
  0 siblings, 0 replies; only message in thread
From: Steve French @ 2022-12-17 15:16 UTC (permalink / raw)
  To: CIFS; +Cc: Paulo Alcantara

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

See attached. Both cc: stable

"cifs: set correct tcon status after initial tree connect"

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.

and

"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.


-- 
Thanks,

Steve

[-- Attachment #2: 0001-cifs-set-correct-tcon-status-after-initial-tree-conn.patch --]
[-- Type: text/x-patch, Size: 1018 bytes --]

From b248586a49a7729f73c504b1e7b958caea45e927 Mon Sep 17 00:00:00 2001
From: Paulo Alcantara <pc@cjr.nz>
Date: Tue, 13 Dec 2022 09:15:23 -0300
Subject: [PATCH 01/17] cifs: set correct tcon status after initial tree
 connect

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>
---
 fs/cifs/connect.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index e80252a83225..eda75c99a0f5 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2600,6 +2600,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,
-- 
2.34.1


[-- Attachment #3: 0002-cifs-set-correct-ipc-status-after-initial-tree-conne.patch --]
[-- Type: text/x-patch, Size: 1325 bytes --]

From 86fe0fa8747fb1bc4cc44fc1966e0959fe752f38 Mon Sep 17 00:00:00 2001
From: Paulo Alcantara <pc@cjr.nz>
Date: Fri, 16 Dec 2022 14:00:19 -0300
Subject: [PATCH 02/17] 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>
---
 fs/cifs/connect.c | 7 +++++--
 1 file 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:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-17 15:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-17 15:16 [PATCH][SMB3 client] Two reconnect patches Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).