summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@cjr.nz>2021-06-05 01:25:33 +0300
committerSteve French <stfrench@microsoft.com>2021-06-21 05:28:17 +0300
commitf3c852b0b0fc0e4ecabbf2e8480c2a088d54b588 (patch)
treef27f88539bb38f7c80cdd3cd812a6886294e3d13 /fs
parentc950fc7af9a7c20b60d7c1ffe5fd4d982ec8cd6c (diff)
downloadlinux-f3c852b0b0fc0e4ecabbf2e8480c2a088d54b588.tar.xz
cifs: do not share tcp servers with dfs mounts
It isn't enough to have unshared tcons because multiple DFS mounts can connect to same target server and failover to different servers, so we can't use a single tcp server for such cases. For the simplest solution, use nosharesock option to achieve that. Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Reviewed-by: Aurelien Aptel <aaptel@suse.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/connect.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 595de4034fa7..43c7e4b27f46 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1944,10 +1944,7 @@ cifs_find_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx)
spin_lock(&cifs_tcp_ses_lock);
list_for_each(tmp, &ses->tcon_list) {
tcon = list_entry(tmp, struct cifs_tcon, tcon_list);
-#ifdef CONFIG_CIFS_DFS_UPCALL
- if (tcon->dfs_path)
- continue;
-#endif
+
if (!match_tcon(tcon, ctx))
continue;
++tcon->tc_count;
@@ -3411,6 +3408,8 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
goto error;
}
+ ctx->nosharesock = true;
+
/* Get path of DFS root */
ref_path = build_unc_path_to_root(ctx, cifs_sb, false);
if (IS_ERR(ref_path)) {