Skip to content

Commit 1f396b9

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: reset connections for all channels when reconnect requested
cifs_reconnect can be called with a flag to mark the session as needing reconnect too. When this is done, we expect the connections of all channels to be reconnected too, which is not happening today. Without doing this, we have seen bad things happen when primary and secondary channels are connected to different servers (in case of cloud services like Azure Files SMB). This change would force all connections to reconnect as well, not just the sessions and tcons. Cc: <stable@vger.kernel.org> Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 037e1ba commit 1f396b9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/smb/client/connect.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,13 @@ static int __cifs_reconnect(struct TCP_Server_Info *server,
377377
if (!cifs_tcp_ses_needs_reconnect(server, 1))
378378
return 0;
379379

380+
/*
381+
* if smb session has been marked for reconnect, also reconnect all
382+
* connections. This way, the other connections do not end up bad.
383+
*/
384+
if (mark_smb_session)
385+
cifs_signal_cifsd_for_reconnect(server, mark_smb_session);
386+
380387
cifs_mark_tcp_ses_conns_for_reconnect(server, mark_smb_session);
381388

382389
cifs_abort_connection(server);

0 commit comments

Comments
 (0)