Commit 8e07757b authored by Shyam Prasad N's avatar Shyam Prasad N Committed by Steve French
Browse files

cifs: do not negotiate session if session already exists



In cifs_get_smb_ses, if we find an existing matching session,
we should not send a negotiate request for the session if a
session reconnect is not necessary.

Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 02102744
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -1943,6 +1943,9 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx)
			 ses->status);

		mutex_lock(&ses->session_mutex);
		if (ses->need_reconnect) {
			cifs_dbg(FYI, "Session needs reconnect\n");

			rc = cifs_negotiate_protocol(xid, ses);
			if (rc) {
				mutex_unlock(&ses->session_mutex);
@@ -1951,8 +1954,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx)
				free_xid(xid);
				return ERR_PTR(rc);
			}
		if (ses->need_reconnect) {
			cifs_dbg(FYI, "Session needs reconnect\n");

			rc = cifs_setup_session(xid, ses,
						ctx->local_nls);
			if (rc) {