[SRU][N:linux-azure][PATCH v2 2/8] cifs: update dstaddr whenever channel iface is updated

Vinicius Peixoto vinicius.peixoto at canonical.com
Mon Jul 28 19:12:27 UTC 2025


From: Shyam Prasad N <sprasad at microsoft.com>

BugLink: https://bugs.launchpad.net/bugs/2118807

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 at vger.kernel.org>
Signed-off-by: Shyam Prasad N <sprasad at microsoft.com>
Signed-off-by: Steve French <stfrench at microsoft.com>
(cherry picked from commit c1846893991f3b4ec8a0cc12219ada153f0814d6)
Signed-off-by: Vinicius Peixoto <vinicius.peixoto at canonical.com>
---
 fs/smb/client/sess.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c
index 3216f786908f..7105787d739b 100644
--- a/fs/smb/client/sess.c
+++ b/fs/smb/client/sess.c
@@ -485,6 +485,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);
 }
 
 /*
-- 
2.45.2




More information about the kernel-team mailing list