]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cifs: dns resolution is needed only for primary channel
authorShyam Prasad N <sprasad@microsoft.com>
Mon, 2 Jun 2025 17:07:16 +0000 (22:37 +0530)
committerSteve French <stfrench@microsoft.com>
Mon, 2 Jun 2025 18:45:10 +0000 (13:45 -0500)
When calling cifs_reconnect, before the connection to the
server is reestablished, the code today does a DNS resolution and
updates server->dstaddr.

However, this is not necessary for secondary channels. Secondary
channels use the interface list returned by the server to decide
which address to connect to. And that happens after tcon is reconnected
and server interfaces are requested.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/connect.c

index ca1cb01c6ef89c18874ffffa7b5d94ea5e0887dc..024817d40c5f51e20f5f2882ed96587ae1bb2d3b 100644 (file)
@@ -392,7 +392,8 @@ static int __cifs_reconnect(struct TCP_Server_Info *server,
                try_to_freeze();
                cifs_server_lock(server);
 
-               if (!cifs_swn_set_server_dstaddr(server)) {
+               if (!cifs_swn_set_server_dstaddr(server) &&
+                   !SERVER_IS_CHAN(server)) {
                        /* resolve the hostname again to make sure that IP address is up-to-date */
                        rc = reconn_set_ipaddr_from_hostname(server);
                        cifs_dbg(FYI, "%s: reconn_set_ipaddr_from_hostname: rc=%d\n", __func__, rc);