cifs: unlock chan_lock before calling cifs_put_tcp_session
authorShyam Prasad N <sprasad@microsoft.com>
Sat, 29 Jan 2022 09:32:33 +0000 (09:32 +0000)
committerSteve French <stfrench@microsoft.com>
Sat, 29 Jan 2022 18:41:54 +0000 (12:41 -0600)
commit489f710a738e24d887823a010b8b206b4124e26f
tree0b34b4297103e44ba14221fcdd7c968ead46a9bd
parent483529f3209f56d4c7a465d045278a2546ae7ed9
cifs: unlock chan_lock before calling cifs_put_tcp_session

While removing an smb session, we need to free up the
tcp session for each channel for that session. We were
doing this with chan_lock held. This results in a
cyclic dependency with cifs_tcp_ses_lock.

For now, unlock the chan_lock temporarily before calling
cifs_put_tcp_session. This should not cause any problem
for now, since we do not remove channels anywhere else.
And this code segment will not be called by two threads.

When we do implement the code for removing channels, we
will need to execute proper ref counting here.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/connect.c