Skip to content

Commit

Permalink
cifs: do not disable interface polling on failure
Browse files Browse the repository at this point in the history
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@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Shyam Prasad N authored and Steve French committed Jun 3, 2025
1 parent b5e3e6e commit 42ca547
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 1 addition & 5 deletions fs/smb/client/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
9 changes: 5 additions & 4 deletions fs/smb/client/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,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) {
Expand All @@ -444,11 +448,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);
}
Expand Down

0 comments on commit 42ca547

Please sign in to comment.