summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@manguebit.com>2025-01-17 21:52:15 +0100
committerSteve French <stfrench@microsoft.com>2025-01-23 03:13:49 +0100
commit056e91cbc9804f15704b5bc2f02f91c23b1abea1 (patch)
tree57ae6d728ddaf6651e9428593c34a7ddcd898492
parentsmb: client: get rid of TCP_Server_Info::refpath_lock (diff)
downloadlinux-056e91cbc9804f15704b5bc2f02f91c23b1abea1.tar.xz
linux-056e91cbc9804f15704b5bc2f02f91c23b1abea1.zip
smb: client: don't check for @leaf_fullpath in match_server()
The matching of DFS connections is already handled by @dfs_conn, so remove @leaf_fullpath matching altogether. Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r--fs/smb/client/connect.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index 1053ef8915fb..880d7cf8b730 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -1526,42 +1526,10 @@ static int match_server(struct TCP_Server_Info *server,
if (!cifs_match_ipaddr((struct sockaddr *)&ctx->srcaddr,
(struct sockaddr *)&server->srcaddr))
return 0;
- /*
- * When matching cifs.ko superblocks (@match_super == true), we can't
- * really match either @server->leaf_fullpath or @server->dstaddr
- * directly since this @server might belong to a completely different
- * server -- in case of domain-based DFS referrals or DFS links -- as
- * provided earlier by mount(2) through 'source' and 'ip' options.
- *
- * Otherwise, match the DFS referral in @server->leaf_fullpath or the
- * destination address in @server->dstaddr.
- *
- * When using 'nodfs' mount option, we avoid sharing it with DFS
- * connections as they might failover.
- */
- if (!match_super) {
- if (!ctx->nodfs) {
- if (server->leaf_fullpath) {
- if (!ctx->leaf_fullpath ||
- strcasecmp(server->leaf_fullpath,
- ctx->leaf_fullpath))
- return 0;
- } else if (ctx->leaf_fullpath) {
- return 0;
- }
- } else if (server->leaf_fullpath) {
- return 0;
- }
- }
- /*
- * Match for a regular connection (address/hostname/port) which has no
- * DFS referrals set.
- */
- if (!server->leaf_fullpath &&
- (strcasecmp(server->hostname, ctx->server_hostname) ||
- !match_server_address(server, addr) ||
- !match_port(server, addr)))
+ if (strcasecmp(server->hostname, ctx->server_hostname) ||
+ !match_server_address(server, addr) ||
+ !match_port(server, addr))
return 0;
if (!match_security(server, ctx))