Skip to content

Commit

Permalink
cifs: take read lock on GlobalSMBSes_lock in is_valid_oplock_break
Browse files Browse the repository at this point in the history
...rather than a write lock. It doesn't change the list so a read lock
should be sufficient.

Signed-off-by: Jeff Layton <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
jtlayton authored and Steve French committed Sep 15, 2009
1 parent 495e993 commit 058daf4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/cifs/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 058daf4

Please sign in to comment.