Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a31e05b authored by Shyam Prasad N's avatar Shyam Prasad N Committed by Greg Kroah-Hartman
Browse files

cifs: return errors during session setup during reconnects



commit 8ea21823aa584b55ba4b861307093b78054b0c1b upstream.

During reconnects, we check the return value from
cifs_negotiate_protocol, and have handlers for both success
and failures. But if that passes, and cifs_setup_session
returns any errors other than -EACCES, we do not handle
that. This fix adds a handler for that, so that we don't
go ahead and try a tree_connect on a failed session.

Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
Reviewed-by: default avatarEnzo Matsumiya <ematsumiya@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8abe88f9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -265,6 +265,9 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
			rc = -EHOSTDOWN;
			mutex_unlock(&tcon->ses->session_mutex);
			goto failed;
		} else if (rc) {
			mutex_unlock(&ses->session_mutex);
			goto out;
		}
	}
	if (rc || !tcon->need_reconnect) {