[SRU][P:linux-azure][PATCH v2 1/8] cifs: reset connections for all channels when reconnect requested
Vinicius Peixoto
vinicius.peixoto at canonical.com
Mon Jul 28 19:12:26 UTC 2025
From: Shyam Prasad N <sprasad at microsoft.com>
BugLink: https://bugs.launchpad.net/bugs/2118807
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 at vger.kernel.org>
Signed-off-by: Shyam Prasad N <sprasad at microsoft.com>
Signed-off-by: Steve French <stfrench at microsoft.com>
(cherry picked from commit 1f396b9bfe39aaf55ea74a7005806164b236653d)
Signed-off-by: Vinicius Peixoto <vinicius.peixoto at canonical.com>
---
fs/smb/client/connect.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index cc9c912db8de..690682dc5ebc 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -377,6 +377,13 @@ static int __cifs_reconnect(struct TCP_Server_Info *server,
if (!cifs_tcp_ses_needs_reconnect(server, 1))
return 0;
+ /*
+ * if smb session has been marked for reconnect, also reconnect all
+ * connections. This way, the other connections do not end up bad.
+ */
+ if (mark_smb_session)
+ cifs_signal_cifsd_for_reconnect(server, mark_smb_session);
+
cifs_mark_tcp_ses_conns_for_reconnect(server, mark_smb_session);
cifs_abort_connection(server);
--
2.45.2
More information about the kernel-team
mailing list