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 <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by Shyam Prasad N and committed by Steve French 46bb1b94 0f2b305a

+7 -2
+7 -2
fs/cifs/connect.c
··· 1397 1397 spin_unlock(&GlobalMid_Lock); 1398 1398 1399 1399 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); 1401 1404 1402 1405 kfree(server->session_key.response); 1403 1406 server->session_key.response = NULL; ··· 1556 1553 list_add(&tcp_ses->tcp_ses_list, &cifs_tcp_ses_list); 1557 1554 spin_unlock(&cifs_tcp_ses_lock); 1558 1555 1559 - cifs_fscache_get_client_cookie(tcp_ses); 1556 + /* fscache server cookies are based on primary channel only */ 1557 + if (!CIFS_SERVER_IS_CHAN(tcp_ses)) 1558 + cifs_fscache_get_client_cookie(tcp_ses); 1560 1559 1561 1560 /* queue echo request delayed work */ 1562 1561 queue_delayed_work(cifsiod_wq, &tcp_ses->echo, tcp_ses->echo_interval);