mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
cifs: force new session setup and tcon for dfs
Do not reuse existing sessions and tcons in DFS failover as it might connect to different servers and shares. Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Cc: stable@vger.kernel.org Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
00c796eecb
commit
fb39d30e22
@ -453,9 +453,7 @@ static int reconnect_target_unlocked(struct TCP_Server_Info *server, struct dfs_
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int reconnect_dfs_server(struct TCP_Server_Info *server)
|
||||||
reconnect_dfs_server(struct TCP_Server_Info *server,
|
|
||||||
bool mark_smb_session)
|
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
const char *refpath = server->current_fullpath + 1;
|
const char *refpath = server->current_fullpath + 1;
|
||||||
@ -479,7 +477,12 @@ reconnect_dfs_server(struct TCP_Server_Info *server,
|
|||||||
if (!cifs_tcp_ses_needs_reconnect(server, num_targets))
|
if (!cifs_tcp_ses_needs_reconnect(server, num_targets))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
cifs_mark_tcp_ses_conns_for_reconnect(server, mark_smb_session);
|
/*
|
||||||
|
* Unconditionally mark all sessions & tcons for reconnect as we might be connecting to a
|
||||||
|
* different server or share during failover. It could be improved by adding some logic to
|
||||||
|
* only do that in case it connects to a different server or share, though.
|
||||||
|
*/
|
||||||
|
cifs_mark_tcp_ses_conns_for_reconnect(server, true);
|
||||||
|
|
||||||
cifs_abort_connection(server);
|
cifs_abort_connection(server);
|
||||||
|
|
||||||
@ -537,7 +540,7 @@ int cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session)
|
|||||||
}
|
}
|
||||||
spin_unlock(&cifs_tcp_ses_lock);
|
spin_unlock(&cifs_tcp_ses_lock);
|
||||||
|
|
||||||
return reconnect_dfs_server(server, mark_smb_session);
|
return reconnect_dfs_server(server);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
int cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session)
|
int cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session)
|
||||||
|
Loading…
Reference in New Issue
Block a user