summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2009-09-12 11:54:29 -0400
committerSteve French <sfrench@us.ibm.com>2009-09-15 19:45:10 +0000
commit058daf4f6795fd23fcca41fe53151cdcbbd263ec (patch)
tree20efa19e535a71cded4ae965a26fe7bcd227525a /fs
parent495e993745a722cfa54d76b97d18e8f30c3e6cea (diff)
cifs: take read lock on GlobalSMBSes_lock in is_valid_oplock_break
...rather than a write lock. It doesn't change the list so a read lock should be sufficient. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index f2d508df7ec..191e6220bc7 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -562,14 +562,14 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
continue;
cifs_stats_inc(&tcon->num_oplock_brks);
- write_lock(&GlobalSMBSeslock);
+ read_lock(&GlobalSMBSeslock);
list_for_each(tmp2, &tcon->openFileList) {
netfile = list_entry(tmp2, struct cifsFileInfo,
tlist);
if (pSMB->Fid != netfile->netfid)
continue;
- write_unlock(&GlobalSMBSeslock);
+ read_unlock(&GlobalSMBSeslock);
read_unlock(&cifs_tcp_ses_lock);
cFYI(1, ("file id match, oplock break"));
pCifsInode = CIFS_I(netfile->pInode);
@@ -584,7 +584,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
return true;
}
- write_unlock(&GlobalSMBSeslock);
+ read_unlock(&GlobalSMBSeslock);
read_unlock(&cifs_tcp_ses_lock);
cFYI(1, ("No matching file for oplock break"));
return true;