diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-09-12 11:54:29 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-09-15 15:45:10 -0400 |
commit | 058daf4f6795fd23fcca41fe53151cdcbbd263ec (patch) | |
tree | 20efa19e535a71cded4ae965a26fe7bcd227525a /fs | |
parent | 495e993745a722cfa54d76b97d18e8f30c3e6cea (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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index f2d508df7ec5..191e6220bc76 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) | |||
562 | continue; | 562 | continue; |
563 | 563 | ||
564 | cifs_stats_inc(&tcon->num_oplock_brks); | 564 | cifs_stats_inc(&tcon->num_oplock_brks); |
565 | write_lock(&GlobalSMBSeslock); | 565 | read_lock(&GlobalSMBSeslock); |
566 | list_for_each(tmp2, &tcon->openFileList) { | 566 | list_for_each(tmp2, &tcon->openFileList) { |
567 | netfile = list_entry(tmp2, struct cifsFileInfo, | 567 | netfile = list_entry(tmp2, struct cifsFileInfo, |
568 | tlist); | 568 | tlist); |
569 | if (pSMB->Fid != netfile->netfid) | 569 | if (pSMB->Fid != netfile->netfid) |
570 | continue; | 570 | continue; |
571 | 571 | ||
572 | write_unlock(&GlobalSMBSeslock); | 572 | read_unlock(&GlobalSMBSeslock); |
573 | read_unlock(&cifs_tcp_ses_lock); | 573 | read_unlock(&cifs_tcp_ses_lock); |
574 | cFYI(1, ("file id match, oplock break")); | 574 | cFYI(1, ("file id match, oplock break")); |
575 | pCifsInode = CIFS_I(netfile->pInode); | 575 | pCifsInode = CIFS_I(netfile->pInode); |
@@ -584,7 +584,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) | |||
584 | 584 | ||
585 | return true; | 585 | return true; |
586 | } | 586 | } |
587 | write_unlock(&GlobalSMBSeslock); | 587 | read_unlock(&GlobalSMBSeslock); |
588 | read_unlock(&cifs_tcp_ses_lock); | 588 | read_unlock(&cifs_tcp_ses_lock); |
589 | cFYI(1, ("No matching file for oplock break")); | 589 | cFYI(1, ("No matching file for oplock break")); |
590 | return true; | 590 | return true; |