Skip to content

Commit 056e91c

Browse files
Paulo AlcantaraSteve French
authored andcommitted
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) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 0a9b00e commit 056e91c

File tree

1 file changed

+3
-35
lines changed

1 file changed

+3
-35
lines changed

fs/smb/client/connect.c

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,42 +1526,10 @@ static int match_server(struct TCP_Server_Info *server,
15261526
if (!cifs_match_ipaddr((struct sockaddr *)&ctx->srcaddr,
15271527
(struct sockaddr *)&server->srcaddr))
15281528
return 0;
1529-
/*
1530-
* When matching cifs.ko superblocks (@match_super == true), we can't
1531-
* really match either @server->leaf_fullpath or @server->dstaddr
1532-
* directly since this @server might belong to a completely different
1533-
* server -- in case of domain-based DFS referrals or DFS links -- as
1534-
* provided earlier by mount(2) through 'source' and 'ip' options.
1535-
*
1536-
* Otherwise, match the DFS referral in @server->leaf_fullpath or the
1537-
* destination address in @server->dstaddr.
1538-
*
1539-
* When using 'nodfs' mount option, we avoid sharing it with DFS
1540-
* connections as they might failover.
1541-
*/
1542-
if (!match_super) {
1543-
if (!ctx->nodfs) {
1544-
if (server->leaf_fullpath) {
1545-
if (!ctx->leaf_fullpath ||
1546-
strcasecmp(server->leaf_fullpath,
1547-
ctx->leaf_fullpath))
1548-
return 0;
1549-
} else if (ctx->leaf_fullpath) {
1550-
return 0;
1551-
}
1552-
} else if (server->leaf_fullpath) {
1553-
return 0;
1554-
}
1555-
}
15561529

1557-
/*
1558-
* Match for a regular connection (address/hostname/port) which has no
1559-
* DFS referrals set.
1560-
*/
1561-
if (!server->leaf_fullpath &&
1562-
(strcasecmp(server->hostname, ctx->server_hostname) ||
1563-
!match_server_address(server, addr) ||
1564-
!match_port(server, addr)))
1530+
if (strcasecmp(server->hostname, ctx->server_hostname) ||
1531+
!match_server_address(server, addr) ||
1532+
!match_port(server, addr))
15651533
return 0;
15661534

15671535
if (!match_security(server, ctx))

0 commit comments

Comments
 (0)