cifs: Fix lookup of SMB connections on multichannel
authorPaulo Alcantara (SUSE) <pc@cjr.nz>
Wed, 4 Dec 2019 14:25:06 +0000 (11:25 -0300)
committerSteve French <stfrench@microsoft.com>
Wed, 4 Dec 2019 17:50:32 +0000 (11:50 -0600)
commit3345bb44bacd99413a3dc0dcd9a99449d88d4dda
tree9c83a5b417a5809c2dee737d21f7e84252a00279
parent43f8a6a74ee2442b9410ed297f5d4c77e7cb5ace
cifs: Fix lookup of SMB connections on multichannel

With the addition of SMB session channels, we introduced new TCP
server pointers that have no sessions or tcons associated with them.

In this case, when we started looking for TCP connections, we might
end up picking session channel rather than the master connection,
hence failing to get either a session or a tcon.

In order to fix that, this patch introduces a new "is_channel" field
to TCP_Server_Info structure so we can skip session channels during
lookup of connections.

Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsglob.h
fs/cifs/connect.c
fs/cifs/sess.c