cifs: make locking consistent around the server session status
authorSteve French <stfrench@microsoft.com>
Thu, 1 Jul 2021 17:22:47 +0000 (12:22 -0500)
committerSteve French <stfrench@microsoft.com>
Fri, 2 Jul 2021 23:35:25 +0000 (18:35 -0500)
commit01cf30825c8729884090151ab97f1c9c5d14a8bc
treed6d98ec0bffb80fb128a4a0bfbe58e6151805dc4
parentbbd91626f71c1582301044f5942751eeb4ca98ba
cifs: make locking consistent around the server session status

There were three places where we were not taking the spinlock
around updates to server->tcpStatus when it was being modified.
To be consistent (also removes Coverity warning) and to remove
possibility of race best to lock all places where it is updated.
Two of the three were in initialization of the field and can't
race - but added lock around the other.

Addresses-Coverity: 1399512 ("Data race condition")
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsglob.h
fs/cifs/connect.c
fs/cifs/transport.c