linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cifs: include regular shares to the list of unshared tcp servers
@ 2021-07-02 17:17 Paulo Alcantara
  2021-07-05 10:51 ` Aurélien Aptel
  0 siblings, 1 reply; 3+ messages in thread
From: Paulo Alcantara @ 2021-07-02 17:17 UTC (permalink / raw)
  To: linux-cifs, smfrench; +Cc: Paulo Alcantara

We need to make regular shares to also not share tcp servers because
we might have both regular and dfs mounts connecting to same server.

Fixes: f3c852b0b0fc ("cifs: do not share tcp servers with dfs mounts")
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
---
 fs/cifs/connect.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 944fb92f50c7..d9471575935f 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3382,6 +3382,12 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
 	char *oldmnt = NULL;
 	bool ref_server = false;
 
+	/*
+	 * Do not share tcp servers when CONFIG_CIFS_DFS_UPCALL option is enabled to properly handle
+	 * reconnect of regular and dfs shares when they were connected to same server.
+	 */
+	ctx->nosharesock = true;
+
 	rc = mount_get_conns(ctx, cifs_sb, &xid, &server, &ses, &tcon);
 	/*
 	 * If called with 'nodfs' mount option, then skip DFS resolving.  Otherwise unconditionally
@@ -3403,8 +3409,6 @@ 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.32.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-05 14:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02 17:17 [PATCH] cifs: include regular shares to the list of unshared tcp servers Paulo Alcantara
2021-07-05 10:51 ` Aurélien Aptel
2021-07-05 14:37   ` Paulo Alcantara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).