Skip to content

Commit

Permalink
cifs: fix the cifs_reconnect path for DFS
Browse files Browse the repository at this point in the history
Recently, the cifs_reconnect code was refactored into
two branches for regular vs dfs codepath. Some of my
recent changes were missing in the dfs path, namely the
code to enable periodic DNS query, and a missing lock.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Shyam Prasad N authored and Steve French committed Jan 19, 2022
1 parent 8a409cd commit e154cb7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,10 @@ static int __cifs_reconnect(struct TCP_Server_Info *server,
}
} while (server->tcpStatus == CifsNeedReconnect);

spin_lock(&cifs_tcp_ses_lock);
if (server->tcpStatus == CifsNeedNegotiate)
mod_delayed_work(cifsiod_wq, &server->echo, 0);
spin_unlock(&cifs_tcp_ses_lock);

wake_up(&server->response_q);
return rc;
Expand Down Expand Up @@ -454,6 +456,7 @@ reconnect_dfs_server(struct TCP_Server_Info *server,
spin_unlock(&cifs_tcp_ses_lock);
cifs_swn_reset_server_dstaddr(server);
mutex_unlock(&server->srv_mutex);
mod_delayed_work(cifsiod_wq, &server->reconnect, 0);
} while (server->tcpStatus == CifsNeedReconnect);

if (target_hint)
Expand Down

0 comments on commit e154cb7

Please sign in to comment.