Commit f3c852b0 authored by Paulo Alcantara's avatar Paulo Alcantara Committed by Steve French
Browse files

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: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: default avatarAurelien Aptel <aaptel@suse.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent c950fc7a
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -1944,10 +1944,7 @@ cifs_find_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx)
	spin_lock(&cifs_tcp_ses_lock);
	spin_lock(&cifs_tcp_ses_lock);
	list_for_each(tmp, &ses->tcon_list) {
	list_for_each(tmp, &ses->tcon_list) {
		tcon = list_entry(tmp, struct cifs_tcon, 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))
		if (!match_tcon(tcon, ctx))
			continue;
			continue;
		++tcon->tc_count;
		++tcon->tc_count;
@@ -3411,6 +3408,8 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
			goto error;
			goto error;
	}
	}


	ctx->nosharesock = true;

	/* Get path of DFS root */
	/* Get path of DFS root */
	ref_path = build_unc_path_to_root(ctx, cifs_sb, false);
	ref_path = build_unc_path_to_root(ctx, cifs_sb, false);
	if (IS_ERR(ref_path)) {
	if (IS_ERR(ref_path)) {