Skip to content

Commit 46bb1b9

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: do not duplicate fscache cookie for secondary channels
We allocate index cookies for each connection from the client. However, we don't need this index for each channel in case of multichannel. So making sure that we avoid creating duplicate cookies by instantiating only for primary channel. Signed-off-by: Shyam Prasad N <[email protected]> Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 0f2b305 commit 46bb1b9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

fs/cifs/connect.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,10 @@ cifs_put_tcp_session(struct TCP_Server_Info *server, int from_reconnect)
13971397
spin_unlock(&GlobalMid_Lock);
13981398

13991399
cifs_crypto_secmech_release(server);
1400-
cifs_fscache_release_client_cookie(server);
1400+
1401+
/* fscache server cookies are based on primary channel only */
1402+
if (!CIFS_SERVER_IS_CHAN(server))
1403+
cifs_fscache_release_client_cookie(server);
14011404

14021405
kfree(server->session_key.response);
14031406
server->session_key.response = NULL;
@@ -1553,7 +1556,9 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx,
15531556
list_add(&tcp_ses->tcp_ses_list, &cifs_tcp_ses_list);
15541557
spin_unlock(&cifs_tcp_ses_lock);
15551558

1556-
cifs_fscache_get_client_cookie(tcp_ses);
1559+
/* fscache server cookies are based on primary channel only */
1560+
if (!CIFS_SERVER_IS_CHAN(tcp_ses))
1561+
cifs_fscache_get_client_cookie(tcp_ses);
15571562

15581563
/* queue echo request delayed work */
15591564
queue_delayed_work(cifsiod_wq, &tcp_ses->echo, tcp_ses->echo_interval);

0 commit comments

Comments
 (0)