]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cifs: update dstaddr whenever channel iface is updated
authorShyam Prasad N <sprasad@microsoft.com>
Mon, 2 Jun 2025 17:07:14 +0000 (22:37 +0530)
committerSteve French <stfrench@microsoft.com>
Mon, 2 Jun 2025 18:34:27 +0000 (13:34 -0500)
When the server interface info changes (more common in clustered
servers like Azure Files), the per-channel iface gets updated.
However, this did not update the corresponding dstaddr. As a result
these channels will still connect (or try connecting) to older addresses.

Fixes: b54034a73baf ("cifs: during reconnect, update interface if necessary")
Cc: <stable@vger.kernel.org>
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/sess.c

index 79b4bd45e31a6edb4fc2c38cc5ed422610c9c349..ec0db32c7d9867204382beeb36428c53d59ef73e 100644 (file)
@@ -445,6 +445,10 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
 
        ses->chans[chan_index].iface = iface;
        spin_unlock(&ses->chan_lock);
+
+       spin_lock(&server->srv_lock);
+       memcpy(&server->dstaddr, &iface->sockaddr, sizeof(server->dstaddr));
+       spin_unlock(&server->srv_lock);
 }
 
 static int