Skip to content

Commit b4f60a0

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: dns resolution is needed only for primary channel
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>
1 parent c184689 commit b4f60a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/smb/client/connect.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ static int __cifs_reconnect(struct TCP_Server_Info *server,
392392
try_to_freeze();
393393
cifs_server_lock(server);
394394

395-
if (!cifs_swn_set_server_dstaddr(server)) {
395+
if (!cifs_swn_set_server_dstaddr(server) &&
396+
!SERVER_IS_CHAN(server)) {
396397
/* resolve the hostname again to make sure that IP address is up-to-date */
397398
rc = reconn_set_ipaddr_from_hostname(server);
398399
cifs_dbg(FYI, "%s: reconn_set_ipaddr_from_hostname: rc=%d\n", __func__, rc);

0 commit comments

Comments
 (0)