Commit 507345b5 authored by Paulo Alcantara's avatar Paulo Alcantara Committed by Steve French

cifs: handle reconnect of tcon when there is no cached dfs referral

When there is no cached DFS referral of tcon->dfs_path, then reconnect
to same share.
Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent c9c9c681
...@@ -4144,7 +4144,8 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru ...@@ -4144,7 +4144,8 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru
if (!tree) if (!tree)
return -ENOMEM; return -ENOMEM;
if (!tcon->dfs_path) { /* If it is not dfs or there was no cached dfs referral, then reconnect to same share */
if (!tcon->dfs_path || dfs_cache_noreq_find(tcon->dfs_path + 1, &ref, &tl)) {
if (tcon->ipc) { if (tcon->ipc) {
scnprintf(tree, MAX_TREE_SIZE, "\\\\%s\\IPC$", server->hostname); scnprintf(tree, MAX_TREE_SIZE, "\\\\%s\\IPC$", server->hostname);
rc = ops->tree_connect(xid, tcon->ses, tree, tcon, nlsc); rc = ops->tree_connect(xid, tcon->ses, tree, tcon, nlsc);
...@@ -4154,9 +4155,6 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru ...@@ -4154,9 +4155,6 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru
goto out; goto out;
} }
rc = dfs_cache_noreq_find(tcon->dfs_path + 1, &ref, &tl);
if (rc)
goto out;
isroot = ref.server_type == DFS_TYPE_ROOT; isroot = ref.server_type == DFS_TYPE_ROOT;
free_dfs_info_param(&ref); free_dfs_info_param(&ref);
......
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