mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
cifs: handle empty list of targets in cifs_reconnect()
commit a52930353e upstream.
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: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Rishabh Bhatnagar <risbhat@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
307ffb7162
commit
2cc5d40e4d
@@ -513,11 +513,13 @@ cifs_reconnect(struct TCP_Server_Info *server)
|
||||
sb = NULL;
|
||||
} else {
|
||||
cifs_sb = CIFS_SB(sb);
|
||||
|
||||
rc = reconn_setup_dfs_targets(cifs_sb, &tgt_list);
|
||||
if (rc && (rc != -EOPNOTSUPP)) {
|
||||
cifs_server_dbg(VFS, "%s: no target servers for DFS failover\n",
|
||||
__func__);
|
||||
if (rc) {
|
||||
cifs_sb = NULL;
|
||||
if (rc != -EOPNOTSUPP) {
|
||||
cifs_server_dbg(VFS, "%s: no target servers for DFS failover\n",
|
||||
__func__);
|
||||
}
|
||||
} else {
|
||||
server->nr_targets = dfs_cache_get_nr_tgts(&tgt_list);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user