diff options
author | Shyam Prasad N <sprasad@microsoft.com> | 2021-07-19 17:05:53 +0000 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-01-07 20:07:07 -0600 |
commit | 080dc5e5656c1cc1cdefb501b9b645a07519f763 (patch) | |
tree | 417e32ff394a376212b5e5d2491564c9eb27c574 /fs/cifs/netmisc.c | |
parent | 183eea2ee5ba968ca7c31f04a0f01fd3e5c1d014 (diff) |
cifs: take cifs_tcp_ses_lock for status checks
While checking/updating status for tcp ses, smb ses or tcon,
we take GlobalMid_Lock. This doesn't make any sense.
Replaced it with cifs_tcp_ses_lock.
Ideally, we should take a spin lock per struct.
But since tcp ses, smb ses and tcon objects won't add up to a lot,
I think there should not be too much contention.
Also, in few other places, these are checked without locking.
Added locking for these.
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/netmisc.c')
-rw-r--r-- | fs/cifs/netmisc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index fa9fbd6a819c..43b16b6d108c 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c @@ -896,10 +896,10 @@ map_and_check_smb_error(struct mid_q_entry *mid, bool logErr) if (class == ERRSRV && code == ERRbaduid) { cifs_dbg(FYI, "Server returned 0x%x, reconnecting session...\n", code); - spin_lock(&GlobalMid_Lock); + spin_lock(&cifs_tcp_ses_lock); if (mid->server->tcpStatus != CifsExiting) mid->server->tcpStatus = CifsNeedReconnect; - spin_unlock(&GlobalMid_Lock); + spin_unlock(&cifs_tcp_ses_lock); } } |