Commit a5293035 authored by Paulo Alcantara's avatar Paulo Alcantara Committed by Steve French

cifs: handle empty list of targets in cifs_reconnect()

In case there were no cached DFS referrals in
reconn_setup_dfs_targets(), set cifs_sb to NULL prior to calling
reconn_set_next_dfs_target() so it would not try to access an empty
tgt_list.
Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: default avatarAurelien Aptel <aaptel@suse.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 7d397a03
...@@ -470,11 +470,13 @@ cifs_reconnect(struct TCP_Server_Info *server) ...@@ -470,11 +470,13 @@ cifs_reconnect(struct TCP_Server_Info *server)
sb = NULL; sb = NULL;
} else { } else {
cifs_sb = CIFS_SB(sb); cifs_sb = CIFS_SB(sb);
rc = reconn_setup_dfs_targets(cifs_sb, &tgt_list); rc = reconn_setup_dfs_targets(cifs_sb, &tgt_list);
if (rc && (rc != -EOPNOTSUPP)) { if (rc) {
cifs_sb = NULL;
if (rc != -EOPNOTSUPP) {
cifs_server_dbg(VFS, "%s: no target servers for DFS failover\n", cifs_server_dbg(VFS, "%s: no target servers for DFS failover\n",
__func__); __func__);
}
} else { } else {
server->nr_targets = dfs_cache_get_nr_tgts(&tgt_list); server->nr_targets = dfs_cache_get_nr_tgts(&tgt_list);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment