Skip to content

Commit 06dc904

Browse files
sprasad-microsoftjohn-cabaj
authored andcommitted
cifs: do not disable interface polling on failure
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@microsoft.com> Cc: stable@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com> (cherry picked from commit 42ca547b13a20e7cbb04fbdf8d5f089ac4bb35b7) Signed-off-by: Vinicius Peixoto <vinicius.peixoto@canonical.com> Acked-by: Manuel Diewald <manuel.diewald@canonical.com> Acked-by: Alessio Faina <alessio.faina@canonical.com> Signed-off-by: Vinicius Peixoto <vinicius.peixoto@canonical.com>
1 parent 84f1fd0 commit 06dc904

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
@@ -116,13 +116,9 @@ static void smb2_query_server_interfaces(struct work_struct *work)
116116
rc = server->ops->query_server_interfaces(xid, tcon, false);
117117
free_xid(xid);
118118

119-
if (rc) {
120-
if (rc == -EOPNOTSUPP)
121-
return;
122-
119+
if (rc)
123120
cifs_dbg(FYI, "%s: failed to query server interfaces: %d\n",
124121
__func__, rc);
125-
}
126122

127123
queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
128124
(SMB_INTERFACE_POLL_INTERVAL * HZ));

fs/smb/client/smb2pdu.c

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

425+
/* regardless of rc value, setup polling */
426+
queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
427+
(SMB_INTERFACE_POLL_INTERVAL * HZ));
428+
425429
mutex_unlock(&ses->session_mutex);
426430

427431
if (rc == -EOPNOTSUPP && ses->chan_count > 1) {
@@ -442,11 +446,8 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
442446
if (ses->chan_max > ses->chan_count &&
443447
ses->iface_count &&
444448
!SERVER_IS_CHAN(server)) {
445-
if (ses->chan_count == 1) {
449+
if (ses->chan_count == 1)
446450
cifs_server_dbg(VFS, "supports multichannel now\n");
447-
queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
448-
(SMB_INTERFACE_POLL_INTERVAL * HZ));
449-
}
450451

451452
cifs_try_adding_channels(ses);
452453
}

0 commit comments

Comments
 (0)