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@xxxxxx> --- 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