Aurélien Aptel <aaptel@xxxxxxxx> writes: > Paulo Alcantara <pc@xxxxxx> writes: >> 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. > > So with this change we never reuse tcp connections, and nosharesock > because the default mount option for all cases. We might as well remove > all the code for searching/matching/reusing tcp connection, smb session, > tree connects. Sounds like a good idea, yes. Of course, if we really want to do this regardless CONFIG_CIFS_DFS_UPCALL, it would probably be better off doing it in a separate series. > That doesn't seem good. If dfs connections are made with the nosharesock > flag they should not be reused already no? The previous version only made sure to not share tcp servers among DFS shares, however, we must do it for all shares when we have CONFIG_CIFS_DFS_UPCALL option enabled. Without this change, the following would occur: mount //dfsroot/dfs (new tcp) mount //dfsroot/share (reuse tcp because rc = mount_get_conns(ctx, cifs_sb, &xid, &server, &ses, &tcon); /* * If called with 'nodfs' mount option, then skip DFS resolving. Otherwise unconditionally * try to get an DFS referral (even cached) to determine whether it is an DFS mount. * * Skip prefix path to provide support for DFS referrals from w2k8 servers which don't seem * to respond with PATH_NOT_COVERED to requests that include the prefix. */ if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS) || dfs_cache_find(xid, ses, cifs_sb->local_nls, cifs_remap(cifs_sb), ctx->UNC + 1, NULL, NULL)) { if (rc) goto error; /* Check if it is fully accessible and then mount it */ rc = is_path_remote(cifs_sb, ctx, xid, server, tcon); if (!rc) goto out; if (rc != -EREMOTE) goto error; } would get executed in cifs_mount() and we only set nosharesock after that) With this patch: mount //dfsroot/dfs (new tcp) mount //dfsroot/share (new tcp)