cifs: avoid race conditions with parallel reconnects
authorShyam Prasad N <sprasad@microsoft.com>
Mon, 20 Mar 2023 06:08:19 +0000 (06:08 +0000)
committerSteve French <stfrench@microsoft.com>
Fri, 24 Mar 2023 14:03:55 +0000 (09:03 -0500)
commitbc962159e8e326af634a506508034a375bf2b858
tree733ddaf358a6b9473122feca390378103bac5f58
parentfddc6ccc487e5de07b98df8d04118d5dcb5e0407
cifs: avoid race conditions with parallel reconnects

When multiple processes/channels do reconnects in parallel
we used to return success immediately
negotiate/session-setup/tree-connect, causing race conditions
between processes that enter the function in parallel.
This caused several errors related to session not found to
show up during parallel reconnects.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/connect.c
fs/cifs/smb2pdu.c
fs/cifs/smb2transport.c