[v1,11/13] cifs: use reconnect timer also for SMB1
diff mbox series

Message ID 20200224131510.20608-12-metze@samba.org
State New
Headers show
Series
  • Avoid reconnects of failed session setups on soft mounts
Related show

Commit Message

Stefan Metzmacher Feb. 24, 2020, 1:15 p.m. UTC
Signed-off-by: Stefan Metzmacher <metze@samba.org>
---
 fs/cifs/cifssmb.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 2cf74028ce70..1ede3a5c6889 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -129,7 +129,7 @@  static int
 cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
 {
 	struct cifs_tcon_reconnect_params params = {
-		.skip_reconnect = false,
+		.start_timer = true,
 	};
 
 	/*
@@ -662,6 +662,12 @@  CIFSSMBEcho(struct TCP_Server_Info *server)
 
 	cifs_dbg(FYI, "In echo request\n");
 
+	if (server->tcpStatus == CifsNeedNegotiate) {
+		/* No need to send echo on newly established connections */
+		mod_delayed_work(cifsiod_wq, &server->reconnect, 0);
+		return rc;
+	}
+
 	rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb);
 	if (rc)
 		return rc;