cifs: prevent data race in cifs_reconnect_tcon()
authorPaulo Alcantara <pc@manguebit.com>
Tue, 28 Feb 2023 22:01:55 +0000 (19:01 -0300)
committerSteve French <stfrench@microsoft.com>
Thu, 1 Jun 2023 04:18:54 +0000 (23:18 -0500)
commit0a20039d4e5e0403e62f35a519d071fea0f6b8e6
tree91a725220f70170cf6b116bd44047e59ee3d134b
parent8deb2a59b8f4997f8c228f80d5faa10e8a353416
cifs: prevent data race in cifs_reconnect_tcon()

Make sure to get an up-to-date TCP_Server_Info::nr_targets value prior
to waiting the server to be reconnected in cifs_reconnect_tcon().  It
is set in cifs_tcp_ses_needs_reconnect() and protected by
TCP_Server_Info::srv_lock.

Create a new cifs_wait_for_server_reconnect() helper that can be used
by both SMB2+ and CIFS reconnect code.

Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsproto.h
fs/cifs/cifssmb.c
fs/cifs/misc.c
fs/cifs/smb2pdu.c