cifs: return errors during session setup during reconnects

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: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
Shyam Prasad N 2022-05-31 12:31:05 +00:00 коммит произвёл Steve French
Родитель c36ee7dab7
Коммит 8ea21823aa
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -288,6 +288,9 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
mutex_unlock(&ses->session_mutex);
rc = -EHOSTDOWN;
goto failed;
} else if (rc) {
mutex_unlock(&ses->session_mutex);
goto out;
}
} else {
mutex_unlock(&ses->session_mutex);