Skip to content

Commit 507345b

Browse files
Paulo Alcantarasmfrench
authored andcommitted
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: Paulo Alcantara (SUSE) <[email protected]> Cc: <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent c9c9c68 commit 507345b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/cifs/connect.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4144,7 +4144,8 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru
41444144
if (!tree)
41454145
return -ENOMEM;
41464146

4147-
if (!tcon->dfs_path) {
4147+
/* If it is not dfs or there was no cached dfs referral, then reconnect to same share */
4148+
if (!tcon->dfs_path || dfs_cache_noreq_find(tcon->dfs_path + 1, &ref, &tl)) {
41484149
if (tcon->ipc) {
41494150
scnprintf(tree, MAX_TREE_SIZE, "\\\\%s\\IPC$", server->hostname);
41504151
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
41544155
goto out;
41554156
}
41564157

4157-
rc = dfs_cache_noreq_find(tcon->dfs_path + 1, &ref, &tl);
4158-
if (rc)
4159-
goto out;
41604158
isroot = ref.server_type == DFS_TYPE_ROOT;
41614159
free_dfs_info_param(&ref);
41624160

0 commit comments

Comments
 (0)