Skip to content

Commit a39c757

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: handle cases where multiple sessions share connection
Based on our implementation of multichannel, it is entirely possible that a server struct may not be found in any channel of an SMB session. In such cases, we should be prepared to move on and search for the server struct in the next session. Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent c6e02ee commit a39c757

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

fs/smb/client/connect.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ cifs_mark_tcp_ses_conns_for_reconnect(struct TCP_Server_Info *server,
233233
list_for_each_entry_safe(ses, nses, &pserver->smb_ses_list, smb_ses_list) {
234234
/* check if iface is still active */
235235
spin_lock(&ses->chan_lock);
236+
if (cifs_ses_get_chan_index(ses, server) ==
237+
CIFS_INVAL_CHAN_INDEX) {
238+
spin_unlock(&ses->chan_lock);
239+
continue;
240+
}
241+
236242
if (!cifs_chan_is_iface_active(ses, server)) {
237243
spin_unlock(&ses->chan_lock);
238244
cifs_chan_update_iface(ses, server);

fs/smb/client/sess.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ cifs_ses_get_chan_index(struct cifs_ses *ses,
8888
if (server)
8989
cifs_dbg(VFS, "unable to get chan index for server: 0x%llx",
9090
server->conn_id);
91-
WARN_ON(1);
9291
return CIFS_INVAL_CHAN_INDEX;
9392
}
9493

0 commit comments

Comments
 (0)