Skip to content

Commit 50a7d2f

Browse files
sprasad-microsoftSasha Levin
authored andcommitted
cifs: do not disable interface polling on failure
commit 42ca547 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 64242d4 commit 50a7d2f

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

fs/smb/client/connect.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,9 @@ static void smb2_query_server_interfaces(struct work_struct *work)
132132
rc = server->ops->query_server_interfaces(xid, tcon, false);
133133
free_xid(xid);
134134

135-
if (rc) {
136-
if (rc == -EOPNOTSUPP)
137-
return;
138-
135+
if (rc)
139136
cifs_dbg(FYI, "%s: failed to query server interfaces: %d\n",
140137
__func__, rc);
141-
}
142138

143139
queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
144140
(SMB_INTERFACE_POLL_INTERVAL * HZ));

fs/smb/client/smb2pdu.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,10 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
440440
free_xid(xid);
441441
ses->flags &= ~CIFS_SES_FLAGS_PENDING_QUERY_INTERFACES;
442442

443+
/* regardless of rc value, setup polling */
444+
queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
445+
(SMB_INTERFACE_POLL_INTERVAL * HZ));
446+
443447
mutex_unlock(&ses->session_mutex);
444448

445449
if (rc == -EOPNOTSUPP && ses->chan_count > 1) {
@@ -460,11 +464,8 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
460464
if (ses->chan_max > ses->chan_count &&
461465
ses->iface_count &&
462466
!SERVER_IS_CHAN(server)) {
463-
if (ses->chan_count == 1) {
467+
if (ses->chan_count == 1)
464468
cifs_server_dbg(VFS, "supports multichannel now\n");
465-
queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
466-
(SMB_INTERFACE_POLL_INTERVAL * HZ));
467-
}
468469

469470
cifs_try_adding_channels(ses);
470471
}

0 commit comments

Comments
 (0)