summaryrefslogtreecommitdiffstats
path: root/fs/cifs/sess.c
diff options
context:
space:
mode:
authorAurelien Aptel <aaptel@suse.com>2020-04-24 15:24:05 +0200
committerSteve French <stfrench@microsoft.com>2020-06-04 13:50:55 -0500
commit8eec79540d2b9cec385707be45f6e9388b34020f (patch)
treee3544323d087c547495019aa4f6d92b95aa04797 /fs/cifs/sess.c
parentedb161353680e6d488d94cbcaf967745bee98d17 (diff)
downloadlinux-8eec79540d2b9cec385707be45f6e9388b34020f.tar.gz
linux-8eec79540d2b9cec385707be45f6e9388b34020f.tar.bz2
linux-8eec79540d2b9cec385707be45f6e9388b34020f.zip
cifs: multichannel: use pointer for binding channel
Add a cifs_chan pointer in struct cifs_ses that points to the channel currently being bound if ses->binding is true. Previously it was always the channel past the established count. This will make reconnecting (and rebinding) a channel easier later on. Signed-off-by: Aurelien Aptel <aaptel@suse.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r--fs/cifs/sess.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 0ae25cc77fc0..1ffdd7dadc55 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -231,7 +231,7 @@ cifs_ses_add_channel(struct cifs_ses *ses, struct cifs_server_iface *iface)
mutex_lock(&ses->session_mutex);
- chan = &ses->chans[ses->chan_count];
+ chan = ses->binding_chan = &ses->chans[ses->chan_count];
chan->server = cifs_get_tcp_session(&vol);
if (IS_ERR(chan->server)) {
rc = PTR_ERR(chan->server);
@@ -276,6 +276,7 @@ cifs_ses_add_channel(struct cifs_ses *ses, struct cifs_server_iface *iface)
atomic_set(&ses->chan_seq, 0);
out:
ses->binding = false;
+ ses->binding_chan = NULL;
mutex_unlock(&ses->session_mutex);
if (rc && chan->server)