smb3: fix lock ordering potential deadlock in cifs_sync_mid_result 6.9-rc5-cifs-fixes-part2
authorSteve French <stfrench@microsoft.com>
Thu, 25 Apr 2024 17:49:50 +0000 (12:49 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 25 Apr 2024 17:49:50 +0000 (12:49 -0500)
commit8861fd5180476f45f9e8853db154600469a0284f
tree42cbc51ff23472582504a63f76056c966a997dae
parent8094a600245e9b28eb36a13036f202ad67c1f887
smb3: fix lock ordering potential deadlock in cifs_sync_mid_result

Coverity spotted that the cifs_sync_mid_result function could deadlock

"Thread deadlock (ORDER_REVERSAL) lock_order: Calling spin_lock acquires
lock TCP_Server_Info.srv_lock while holding lock TCP_Server_Info.mid_lock"

Addresses-Coverity: 1590401 ("Thread deadlock (ORDER_REVERSAL)")
Cc: stable@vger.kernel.org
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/transport.c