All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@cjr.nz>
To: linux-cifs@vger.kernel.org, smfrench@gmail.com
Cc: Paulo Alcantara <pc@cjr.nz>
Subject: [PATCH 7/7] cifs: do not share tcp servers with dfs mounts
Date: Fri,  4 Jun 2021 19:25:33 -0300	[thread overview]
Message-ID: <20210604222533.4760-8-pc@cjr.nz> (raw)
In-Reply-To: <20210604222533.4760-1-pc@cjr.nz>

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>
---
 fs/cifs/connect.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index cece0c2249c3..05f5c84a63a4 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1938,10 +1938,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;
@@ -3406,6 +3403,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)) {
-- 
2.31.1


  parent reply	other threads:[~2021-06-04 22:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04 22:25 [PATCH 0/7] dfs fixes Paulo Alcantara
2021-06-04 22:25 ` [PATCH 1/7] cifs: do not send tree disconnect to ipc shares Paulo Alcantara
2021-06-04 22:25 ` [PATCH 2/7] cifs: get rid of @noreq param in __dfs_cache_find() Paulo Alcantara
2021-06-04 22:25 ` [PATCH 3/7] cifs: keep referral server sessions alive Paulo Alcantara
2021-06-04 22:25 ` [PATCH 4/7] cifs: handle different charsets in dfs cache Paulo Alcantara
2021-06-04 22:25 ` [PATCH 5/7] cifs: fix path comparison and hash calc Paulo Alcantara
2021-06-05 21:04   ` Steve French
2021-06-04 22:25 ` [PATCH 6/7] cifs: set a minimum of 2 minutes for refreshing dfs cache Paulo Alcantara
2021-06-04 22:25 ` Paulo Alcantara [this message]
2021-06-05 21:05 ` [PATCH 0/7] dfs fixes Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210604222533.4760-8-pc@cjr.nz \
    --to=pc@cjr.nz \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.