const char *dfs_host;
size_t dfs_host_len;
char *share = NULL, *prefix = NULL;
+ struct dfs_info3_param ref = {0};
+ bool isroot;
tree = kzalloc(MAX_TREE_SIZE, GFP_KERNEL);
if (!tree)
goto out;
}
- rc = dfs_cache_noreq_find(tcon->dfs_path + 1, NULL, &tl);
+ rc = dfs_cache_noreq_find(tcon->dfs_path + 1, &ref, &tl);
if (rc)
goto out;
+ isroot = ref.server_type == DFS_TYPE_ROOT;
+ free_dfs_info_param(&ref);
extract_unc_hostname(server->hostname, &tcp_host, &tcp_host_len);
} else {
scnprintf(tree, MAX_TREE_SIZE, "\\%s", share);
rc = ops->tree_connect(xid, tcon->ses, tree, tcon, nlsc);
- if (!rc) {
+ /* Only handle prefix paths of DFS link targets */
+ if (!rc && !isroot) {
rc = update_super_prepath(tcon, prefix);
break;
}