diff options
author | Shyam Prasad N <sprasad@microsoft.com> | 2021-07-19 20:05:53 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-01-08 05:07:07 +0300 |
commit | 080dc5e5656c1cc1cdefb501b9b645a07519f763 (patch) | |
tree | 417e32ff394a376212b5e5d2491564c9eb27c574 /fs/cifs/sess.c | |
parent | 183eea2ee5ba968ca7c31f04a0f01fd3e5c1d014 (diff) | |
download | linux-080dc5e5656c1cc1cdefb501b9b645a07519f763.tar.xz |
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/sess.c')
-rw-r--r-- | fs/cifs/sess.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 61fc8cb1ec8f..03ba30843950 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -369,10 +369,10 @@ void cifs_ses_mark_for_reconnect(struct cifs_ses *ses) int i; for (i = 0; i < ses->chan_count; i++) { - spin_lock(&GlobalMid_Lock); + spin_lock(&cifs_tcp_ses_lock); if (ses->chans[i].server->tcpStatus != CifsExiting) ses->chans[i].server->tcpStatus = CifsNeedReconnect; - spin_unlock(&GlobalMid_Lock); + spin_unlock(&cifs_tcp_ses_lock); } } @@ -1052,9 +1052,9 @@ sess_establish_session(struct sess_data *sess_data) spin_unlock(&ses->chan_lock); /* Even if one channel is active, session is in good state */ - spin_lock(&GlobalMid_Lock); + spin_lock(&cifs_tcp_ses_lock); ses->status = CifsGood; - spin_unlock(&GlobalMid_Lock); + spin_unlock(&cifs_tcp_ses_lock); return 0; } |