Skip to content

Commit 8b49a35

Browse files
sprasad-microsoftjohn-cabaj
authored andcommitted
cifs: update dstaddr whenever channel iface is updated
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: b54034a ("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> (cherry picked from commit c1846893991f3b4ec8a0cc12219ada153f0814d6) Signed-off-by: Vinicius Peixoto <vinicius.peixoto@canonical.com> Acked-by: Manuel Diewald <manuel.diewald@canonical.com> Acked-by: Alessio Faina <alessio.faina@canonical.com> Signed-off-by: Vinicius Peixoto <vinicius.peixoto@canonical.com>
1 parent 0d3b3a3 commit 8b49a35

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/smb/client/sess.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,10 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
445445

446446
ses->chans[chan_index].iface = iface;
447447
spin_unlock(&ses->chan_lock);
448+
449+
spin_lock(&server->srv_lock);
450+
memcpy(&server->dstaddr, &iface->sockaddr, sizeof(server->dstaddr));
451+
spin_unlock(&server->srv_lock);
448452
}
449453

450454
static int

0 commit comments

Comments
 (0)