[SRU][P:linux-azure][PATCH v2 6/8] cifs: do not disable interface polling on failure
Vinicius Peixoto
vinicius.peixoto at canonical.com
Mon Jul 28 19:12:36 UTC 2025
From: Shyam Prasad N <sprasad at microsoft.com>
BugLink: https://bugs.launchpad.net/bugs/2118807
When a server has multichannel enabled, we keep polling the server
for interfaces periodically. However, when this query fails, we
disable the polling. This can be problematic as it takes away the
chance for the server to start advertizing again.
This change reschedules the delayed work, even if the current call
failed. That way, multichannel sessions can recover.
Signed-off-by: Shyam Prasad N <sprasad at microsoft.com>
Cc: stable at vger.kernel.org
Signed-off-by: Steve French <stfrench at microsoft.com>
(cherry picked from commit 42ca547b13a20e7cbb04fbdf8d5f089ac4bb35b7)
Signed-off-by: Vinicius Peixoto <vinicius.peixoto at canonical.com>
---
fs/smb/client/connect.c | 6 +-----
fs/smb/client/smb2pdu.c | 9 +++++----
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index 7bb73d224877..f86e2da14d08 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -116,13 +116,9 @@ static void smb2_query_server_interfaces(struct work_struct *work)
rc = server->ops->query_server_interfaces(xid, tcon, false);
free_xid(xid);
- if (rc) {
- if (rc == -EOPNOTSUPP)
- return;
-
+ if (rc)
cifs_dbg(FYI, "%s: failed to query server interfaces: %d\n",
__func__, rc);
- }
queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
(SMB_INTERFACE_POLL_INTERVAL * HZ));
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
index e98dc7561a70..171aeb5bfece 100644
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -422,6 +422,10 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
free_xid(xid);
ses->flags &= ~CIFS_SES_FLAGS_PENDING_QUERY_INTERFACES;
+ /* regardless of rc value, setup polling */
+ queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
+ (SMB_INTERFACE_POLL_INTERVAL * HZ));
+
mutex_unlock(&ses->session_mutex);
if (rc == -EOPNOTSUPP && ses->chan_count > 1) {
@@ -442,11 +446,8 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
if (ses->chan_max > ses->chan_count &&
ses->iface_count &&
!SERVER_IS_CHAN(server)) {
- if (ses->chan_count == 1) {
+ if (ses->chan_count == 1)
cifs_server_dbg(VFS, "supports multichannel now\n");
- queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
- (SMB_INTERFACE_POLL_INTERVAL * HZ));
- }
cifs_try_adding_channels(ses);
}
--
2.45.2
More information about the kernel-team
mailing list