From: nspmangalore@gmail.com
To: linux-cifs@vger.kernel.org, smfrench@gmail.com,
bharathsm.hsk@gmail.com, meetakshisetiyaoss@gmail.com,
pc@manguebit.com
Cc: Shyam Prasad N <sprasad@microsoft.com>, stable@vger.kernel.org
Subject: [PATCH 2/6] cifs: reset connections for all channels when reconnect requested
Date: Mon, 2 Jun 2025 22:37:13 +0530 [thread overview]
Message-ID: <20250602170842.809099-2-sprasad@microsoft.com> (raw)
In-Reply-To: <20250602170842.809099-1-sprasad@microsoft.com>
From: Shyam Prasad N <sprasad@microsoft.com>
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>
---
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 6bf04d9a5491..ca1cb01c6ef8 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.43.0
next prev parent reply other threads:[~2025-06-02 17:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-02 17:07 [PATCH 1/6] cifs: deal with the channel loading lag while picking channels nspmangalore
2025-06-02 17:07 ` nspmangalore [this message]
2025-06-02 17:07 ` [PATCH 3/6] cifs: update dstaddr whenever channel iface is updated nspmangalore
2025-06-02 17:07 ` [PATCH 4/6] cifs: serialize other channels when query server interfaces is pending nspmangalore
2025-06-02 17:07 ` [PATCH 5/6] cifs: dns resolution is needed only for primary channel nspmangalore
2025-06-02 17:07 ` [PATCH 6/6] cifs: do not disable interface polling on failure nspmangalore
2025-06-02 18:47 ` [PATCH 1/6] cifs: deal with the channel loading lag while picking channels Steve French
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250602170842.809099-2-sprasad@microsoft.com \
--to=nspmangalore@gmail.com \
--cc=bharathsm.hsk@gmail.com \
--cc=linux-cifs@vger.kernel.org \
--cc=meetakshisetiyaoss@gmail.com \
--cc=pc@manguebit.com \
--cc=smfrench@gmail.com \
--cc=sprasad@microsoft.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox