diff mbox series

[05/14] cifs: force interface update before a fresh session setup

Message ID 20231030110020.45627-5-sprasad@microsoft.com
State New
Headers show
Series [01/14] cifs: print server capabilities in DebugData | expand

Commit Message

Shyam Prasad N Oct. 30, 2023, 11 a.m. UTC
From: Shyam Prasad N <sprasad@microsoft.com>

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).

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
---
 fs/smb/client/connect.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Steve French Nov. 1, 2023, 3:14 a.m. UTC | #1
merged into cifs-2.6.git for-next pending testing

And added cc:stable

On Mon, Oct 30, 2023 at 6:00 AM <nspmangalore@gmail.com> wrote:
>
> From: Shyam Prasad N <sprasad@microsoft.com>
>
> 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).
>
> Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
> ---
>  fs/smb/client/connect.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
> index c993c7a3415a..97c9a32cff36 100644
> --- a/fs/smb/client/connect.c
> +++ b/fs/smb/client/connect.c
> @@ -3854,8 +3854,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 */
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index c993c7a3415a..97c9a32cff36 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -3854,8 +3854,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 */