Skip to content

Commit 42ca547

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: do not disable interface polling on failure
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 <[email protected]> Cc: [email protected] Signed-off-by: Steve French <[email protected]>
1 parent b5e3e6e commit 42ca547

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
@@ -424,6 +424,10 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
424424
free_xid(xid);
425425
ses->flags &= ~CIFS_SES_FLAGS_PENDING_QUERY_INTERFACES;
426426

427+
/* regardless of rc value, setup polling */
428+
queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
429+
(SMB_INTERFACE_POLL_INTERVAL * HZ));
430+
427431
mutex_unlock(&ses->session_mutex);
428432

429433
if (rc == -EOPNOTSUPP && ses->chan_count > 1) {
@@ -444,11 +448,8 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
444448
if (ses->chan_max > ses->chan_count &&
445449
ses->iface_count &&
446450
!SERVER_IS_CHAN(server)) {
447-
if (ses->chan_count == 1) {
451+
if (ses->chan_count == 1)
448452
cifs_server_dbg(VFS, "supports multichannel now\n");
449-
queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
450-
(SMB_INTERFACE_POLL_INTERVAL * HZ));
451-
}
452453

453454
cifs_try_adding_channels(ses);
454455
}

0 commit comments

Comments
 (0)