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>
Thu, 10 Feb 2022 02:14:48 +0000 (20:14 -0600)
commita87ffbee0cca10e5190176b58c810936c1b8d899
treeb9468c4d6eec4a86ef05cce7e83073a742dfc324
parent8160406925608df3d5959bc7239dc078fd623e47
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