mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
cifs: use correct lock type in cifs_reconnect()
commit cd70a3e898
upstream.
TCP_Server_Info::origin_fullpath and TCP_Server_Info::leaf_fullpath
are protected by refpath_lock mutex and not cifs_tcp_ses_lock
spinlock.
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Cc: stable@vger.kernel.org
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8d59b6686c
commit
a6b48566dc
1 changed files with 8 additions and 1 deletions
|
@ -534,12 +534,19 @@ int cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session)
|
|||
{
|
||||
/* If tcp session is not an dfs connection, then reconnect to last target server */
|
||||
spin_lock(&cifs_tcp_ses_lock);
|
||||
if (!server->is_dfs_conn || !server->origin_fullpath || !server->leaf_fullpath) {
|
||||
if (!server->is_dfs_conn) {
|
||||
spin_unlock(&cifs_tcp_ses_lock);
|
||||
return __cifs_reconnect(server, mark_smb_session);
|
||||
}
|
||||
spin_unlock(&cifs_tcp_ses_lock);
|
||||
|
||||
mutex_lock(&server->refpath_lock);
|
||||
if (!server->origin_fullpath || !server->leaf_fullpath) {
|
||||
mutex_unlock(&server->refpath_lock);
|
||||
return __cifs_reconnect(server, mark_smb_session);
|
||||
}
|
||||
mutex_unlock(&server->refpath_lock);
|
||||
|
||||
return reconnect_dfs_server(server);
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue