aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2transport.c
diff options
context:
space:
mode:
authorShyam Prasad N <sprasad@microsoft.com>2022-10-28 09:52:26 +0000
committerSteve French <stfrench@microsoft.com>2022-11-04 23:34:02 -0500
commit8abcaeaed38109e5ccaf40218e0e9e387f07bfe6 (patch)
tree53a2aa91d04edd533521b86edf6e1541ca4d5619 /fs/cifs/smb2transport.c
parentLinux 6.1-rc3 (diff)
downloadlinux-dev-8abcaeaed38109e5ccaf40218e0e9e387f07bfe6.tar.xz
linux-dev-8abcaeaed38109e5ccaf40218e0e9e387f07bfe6.zip
cifs: always iterate smb sessions using primary channel
smb sessions and tcons currently hang off primary channel only. Secondary channels have the lists as empty. Whenever there's a need to iterate sessions or tcons, we should use the list in the corresponding primary channel. Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to '')
-rw-r--r--fs/cifs/smb2transport.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
index 8e3f26e6f6b9..8a9d9d08cf19 100644
--- a/fs/cifs/smb2transport.c
+++ b/fs/cifs/smb2transport.c
@@ -136,9 +136,13 @@ out:
static struct cifs_ses *
smb2_find_smb_ses_unlocked(struct TCP_Server_Info *server, __u64 ses_id)
{
+ struct TCP_Server_Info *pserver;
struct cifs_ses *ses;
- list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
+ /* If server is a channel, select the primary channel */
+ pserver = CIFS_SERVER_IS_CHAN(server) ? server->primary_server : server;
+
+ list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
if (ses->Suid != ses_id)
continue;
++ses->ses_count;