diff options
author | Samuel Cabrero <scabrero@suse.de> | 2020-11-30 19:02:56 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-12-14 09:18:55 -0600 |
commit | 121d947d4fe15bcec90bcfc1249ee9b739cb9258 (patch) | |
tree | 4f27efeea2e92dcd92b5d3180853416f98415c84 /fs/cifs/connect.c | |
parent | af1e40d9ac8417839d955ca1ac42f754588937a9 (diff) | |
download | lwn-121d947d4fe15bcec90bcfc1249ee9b739cb9258.tar.gz lwn-121d947d4fe15bcec90bcfc1249ee9b739cb9258.zip |
cifs: Handle witness client move notification
This message is sent to tell a client to close its current connection
and connect to the specified address.
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 1c8b08c06ad7..9f59fe2a03e6 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -312,13 +312,24 @@ cifs_reconnect(struct TCP_Server_Info *server) try_to_freeze(); mutex_lock(&server->srv_mutex); + +#ifdef CONFIG_CIFS_SWN_UPCALL + if (server->use_swn_dstaddr) { + server->dstaddr = server->swn_dstaddr; + } else { +#endif + #ifdef CONFIG_CIFS_DFS_UPCALL - /* - * Set up next DFS target server (if any) for reconnect. If DFS - * feature is disabled, then we will retry last server we - * connected to before. - */ - reconn_set_next_dfs_target(server, cifs_sb, &tgt_list, &tgt_it); + /* + * Set up next DFS target server (if any) for reconnect. If DFS + * feature is disabled, then we will retry last server we + * connected to before. + */ + reconn_set_next_dfs_target(server, cifs_sb, &tgt_list, &tgt_it); +#endif + +#ifdef CONFIG_CIFS_SWN_UPCALL + } #endif if (cifs_rdma_enabled(server)) @@ -336,6 +347,9 @@ cifs_reconnect(struct TCP_Server_Info *server) if (server->tcpStatus != CifsExiting) server->tcpStatus = CifsNeedNegotiate; spin_unlock(&GlobalMid_Lock); +#ifdef CONFIG_CIFS_SWN_UPCALL + server->use_swn_dstaddr = false; +#endif mutex_unlock(&server->srv_mutex); } } while (server->tcpStatus == CifsNeedReconnect); |