From: Henrique Carvalho <henrique.carvalho@suse.com>
To: sfrench@samba.org
Cc: pc@manguebit.org, ronniesahlberg@gmail.com,
sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com,
ematsumiya@suse.de, linux-cifs@vger.kernel.org,
stable@vger.kernel.org
Subject: [PATCH 2/2] smb: client: pass correct from_reconnect to cifs_put_tcp_session()
Date: Mon, 13 Apr 2026 16:11:10 -0300 [thread overview]
Message-ID: <20260413191110.1508848-2-henrique.carvalho@suse.com> (raw)
In-Reply-To: <20260413191110.1508848-1-henrique.carvalho@suse.com>
cifs_decrease_secondary_channels() tore down removed channels with
from_reconnect=false, even when the shrink was triggered from reconnect
context, which could synchronously wait on reconnect work and break the
reconnect-side teardown path.
Pass down the from_reconnect argument to cifs_put_tcp_session() so
reconnect-driven channel removal uses the same non-blocking teardown
semantics as the rest of the reconnect path.
This is a minor fix. I believe this bug cannot be triggered in the
current state of cifs.
Fixes: ee1d21794e55 ("cifs: handle when server stops supporting multichannel")
Cc: stable@vger.kernel.org
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
---
fs/smb/client/cifsproto.h | 1 +
fs/smb/client/sess.c | 4 ++--
fs/smb/client/smb2pdu.c | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/smb/client/cifsproto.h b/fs/smb/client/cifsproto.h
index 884bfa1cf0b4..b00b2e070ada 100644
--- a/fs/smb/client/cifsproto.h
+++ b/fs/smb/client/cifsproto.h
@@ -374,6 +374,7 @@ bool cifs_chan_needs_reconnect(struct cifs_ses *ses,
bool cifs_chan_is_iface_active(struct cifs_ses *ses,
struct TCP_Server_Info *server);
void cifs_decrease_secondary_channels(struct cifs_ses *ses,
+ bool from_reconnect,
bool disable_mchan);
void cifs_chan_update_iface(struct cifs_ses *ses,
struct TCP_Server_Info *server);
diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c
index 698bd27119ae..47bb566c8731 100644
--- a/fs/smb/client/sess.c
+++ b/fs/smb/client/sess.c
@@ -273,7 +273,7 @@ int cifs_try_adding_channels(struct cifs_ses *ses)
* Otherwise, it disables all but the primary channel.
*/
void
-cifs_decrease_secondary_channels(struct cifs_ses *ses, bool disable_mchan)
+cifs_decrease_secondary_channels(struct cifs_ses *ses, bool from_reconnect, bool disable_mchan)
{
int i, chan_count;
struct TCP_Server_Info *server;
@@ -319,7 +319,7 @@ cifs_decrease_secondary_channels(struct cifs_ses *ses, bool disable_mchan)
server->terminate = true;
cifs_signal_cifsd_for_reconnect(server, false);
}
- cifs_put_tcp_session(server, false);
+ cifs_put_tcp_session(server, from_reconnect);
}
spin_lock(&ses->chan_lock);
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
index 2eb13b2665a4..cf7b74a2b9b0 100644
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -206,7 +206,7 @@ cifs_chan_skip_or_disable(struct cifs_ses *ses,
return -EHOSTDOWN;
}
- cifs_decrease_secondary_channels(ses, disable_mchan);
+ cifs_decrease_secondary_channels(ses, from_reconnect, disable_mchan);
return 0;
}
--
2.53.0
next prev parent reply other threads:[~2026-04-13 19:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 19:11 [PATCH 1/2] smb: client: serialize channel scaling path Henrique Carvalho
2026-04-13 19:11 ` Henrique Carvalho [this message]
2026-04-16 5:59 ` [PATCH 2/2] smb: client: pass correct from_reconnect to cifs_put_tcp_session() RAJASI MANDAL
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=20260413191110.1508848-2-henrique.carvalho@suse.com \
--to=henrique.carvalho@suse.com \
--cc=bharathsm@microsoft.com \
--cc=ematsumiya@suse.de \
--cc=linux-cifs@vger.kernel.org \
--cc=pc@manguebit.org \
--cc=ronniesahlberg@gmail.com \
--cc=sfrench@samba.org \
--cc=sprasad@microsoft.com \
--cc=stable@vger.kernel.org \
--cc=tom@talpey.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).