diff options
author | Aurelien Aptel <aaptel@suse.com> | 2020-04-24 16:55:31 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-06-04 13:50:55 -0500 |
commit | 2f58967979409ea3ec799343aa35e9007f735a3b (patch) | |
tree | 9178aafea756cb177294fec6d4e872a18196b6fa /fs/cifs/sess.c | |
parent | 8eec79540d2b9cec385707be45f6e9388b34020f (diff) | |
download | linux-2f58967979409ea3ec799343aa35e9007f735a3b.tar.bz2 |
cifs: multichannel: try to rebind when reconnecting a channel
first steps in trying to make channels properly reconnect.
* add cifs_ses_find_chan() function to find the enclosing cifs_chan
struct it belongs to
* while we have the session lock and are redoing negprot and
sess.setup in smb2_reconnect() redo the binding of channels.
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.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 1ffdd7dadc55..5d05bd2822d2 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -150,6 +150,22 @@ int cifs_try_adding_channels(struct cifs_ses *ses) return ses->chan_count - old_chan_count; } +/* + * If server is a channel of ses, return the corresponding enclosing + * cifs_chan otherwise return NULL. + */ +struct cifs_chan * +cifs_ses_find_chan(struct cifs_ses *ses, struct TCP_Server_Info *server) +{ + int i; + + for (i = 0; i < ses->chan_count; i++) { + if (ses->chans[i].server == server) + return &ses->chans[i]; + } + return NULL; +} + int cifs_ses_add_channel(struct cifs_ses *ses, struct cifs_server_iface *iface) { |