cifs: force interface update before a fresh session setup
authorSteve French <stfrench@microsoft.com>
Fri, 26 Jan 2024 05:47:54 +0000 (23:47 -0600)
committerSteve French <stfrench@microsoft.com>
Sat, 27 Jan 2024 06:14:31 +0000 (00:14 -0600)
During a session reconnect, it is possible that the
server moved to another physical server (happens in case
of Azure files). So at this time, force a query of server
interfaces again (in case of multichannel session), such
that the secondary channels connect to the right
IP addresses (possibly updated now).

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

index 129981ca422d35a5e550ece5bebe9a700f5168e8..37f586107db0c6f2c493af34324a4af479d5c9c0 100644 (file)
@@ -3858,8 +3858,12 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
        is_binding = !CIFS_ALL_CHANS_NEED_RECONNECT(ses);
        spin_unlock(&ses->chan_lock);
 
-       if (!is_binding)
+       if (!is_binding) {
                ses->ses_status = SES_IN_SETUP;
+
+               /* force iface_list refresh */
+               ses->iface_last_update = 0;
+       }
        spin_unlock(&ses->ses_lock);
 
        /* update ses ip_addr only for primary chan */