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@xxxxxx> --- fs/cifs/connect.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 3ca06bd88b6e..3956672a11ae 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -536,8 +536,11 @@ int cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session) return __cifs_reconnect(server, mark_smb_session); } spin_unlock(&cifs_tcp_ses_lock); - - return reconnect_dfs_server(server, mark_smb_session); + /* + * Ignore @mark_smb_session and invalidate all sessions & tcons as we might be connecting to + * a different server or share during failover. + */ + return reconnect_dfs_server(server, true); } #else int cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session) -- 2.35.1