diff options
Diffstat (limited to 'fs/smb/client/sess.c')
| -rw-r--r-- | fs/smb/client/sess.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c index af39c819822f..5c2725eee933 100644 --- a/fs/smb/client/sess.c +++ b/fs/smb/client/sess.c @@ -170,8 +170,6 @@ static int try_adding_channels(struct cifs_ses *ses, struct list_head *ifaces) spin_unlock(&pserver->iface_lock); list_for_each_entry_safe(iface, niface, ifaces, iface_head) { - rc = 0; - /* do not mix rdma and non-rdma interfaces */ if (iface->rdma_capable != ses->server->rdma) continue; @@ -185,7 +183,15 @@ static int try_adding_channels(struct cifs_ses *ses, struct list_head *ifaces) if (iface->weight_fulfilled >= weight) continue; - rc = cifs_ses_add_channel(ses, iface); + rc = 0; + if (!iface->is_primary) { + rc = cifs_ses_add_channel(ses, iface); + } else { + spin_lock(&ses->chan_lock); + ses->chans[0].iface = iface; + spin_unlock(&ses->chan_lock); + } + if (!rc) { cifs_info("successfully opened new channel on iface:%pIS\n", &iface->sockaddr); iface->is_active = 1; @@ -195,7 +201,7 @@ static int try_adding_channels(struct cifs_ses *ses, struct list_head *ifaces) spin_lock(&pserver->iface_lock); pserver->iface_count++; - list_move(&iface->iface_head, &pserver->iface_list); + list_move_tail(&iface->iface_head, &pserver->iface_list); pserver->iface_last_update = jiffies; spin_unlock(&pserver->iface_lock); |
