b0VIM 8.1^fBCnsmfrenchsmfrench-ThinkPad-P52~smfrench/cifs-2.6/fs/cifs/0003-cifs-multichannel-use-pointer-for-binding-channel.patch 3210#"! UtpZadaZl#"kj#" s @ ? h ;   D  c F ? / , * & I    \U>;\Z75i miba`2.20.1-- if (rc && chan->server) mutex_unlock(&ses->session_mutex);+ ses->binding_chan = NULL; ses->binding = false; out: atomic_set(&ses->chan_seq, 0);@@ -274,6 +274,7 @@ cifs_ses_add_channel(struct cifs_ses *ses, struct cifs_server_iface *iface) rc = PTR_ERR(chan->server); if (IS_ERR(chan->server)) { chan->server = cifs_get_tcp_session(&vol);+ chan = ses->binding_chan = &ses->chans[ses->chan_count];- chan = &ses->chans[ses->chan_count]; mutex_lock(&ses->session_mutex); @@ -229,7 +229,7 @@ cifs_ses_add_channel(struct cifs_ses *ses, struct cifs_server_iface *iface)+++ b/fs/cifs/sess.c--- a/fs/cifs/sess.cindex 43a88e26d26b..9a426db21fae 100644diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c } return ses->server; else+ return ses->binding_chan->server;- return ses->chans[ses->chan_count].server; if (ses->binding) { struct TCP_Server_Info *cifs_ses_server(struct cifs_ses *ses) static inline+ */+ * the other requests see cifs_pick_channel().+ * This function should be use for negprot/sess.setup codepaths. For+ *+ * yet.+ * channel this returns the last channel which isn't fully established+ * Returns the server pointer of the session. When binding a new+/* } return NULL; else+ return ses->binding_chan;- return &ses->chans[ses->chan_count]; if (ses->binding) { struct cifs_chan *cifs_ses_binding_channel(struct cifs_ses *ses) static inline */+ * established yet.- * established yet (one past the established count) * When binding a new channel, we need to access the channel which isn't fully /* @@ -1036,23 +1037,31 @@ struct cifs_ses { atomic_t chan_seq; /* round robin state */ size_t chan_max; size_t chan_count;+ struct cifs_chan *binding_chan; struct cifs_chan chans[CIFS_MAX_CHANNELS]; #define CIFS_MAX_CHANNELS 16 @@ -1029,6 +1029,7 @@ struct cifs_ses {+++ b/fs/cifs/cifsglob.h--- a/fs/cifs/cifsglob.hindex e102ca63d594..3350d1ab7692 100644diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h 2 files changed, 14 insertions(+), 4 deletions(-) fs/cifs/sess.c | 3 ++- fs/cifs/cifsglob.h | 15 ++++++++++++------Signed-off-by: Steve French Signed-off-by: Aurelien Aptel This will make reconnecting (and rebinding) a channel easier later on.Previously it was always the channel past the established count.currently being bound if ses->binding is true.Add a cifs_chan pointer in struct cifs_ses that points to the channelSubject: [PATCH 3/4] cifs: multichannel: use pointer for binding channelDate: Fri, 24 Apr 2020 15:24:05 +0200From: Aurelien Aptel From 2770b7f586aca37084f6363c317b41facec61c90 Mon Sep 17 00:00:00 2001