Skip to content

Commit

Permalink
cifs: force interface update before a fresh session setup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shyam Prasad N authored and Steve French committed Nov 2, 2023
1 parent 6e5e64c commit d9a6d78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/smb/client/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -3849,8 +3849,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 */
Expand Down

0 comments on commit d9a6d78

Please sign in to comment.