aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/file.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 1dc9dea2ae70..1e57f36ea1b2 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -561,11 +561,10 @@ cifs_relock_file(struct cifsFileInfo *cfile)
561 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 561 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
562 int rc = 0; 562 int rc = 0;
563 563
564 /* we are going to update can_cache_brlcks here - need a write access */ 564 down_read(&cinode->lock_sem);
565 down_write(&cinode->lock_sem);
566 if (cinode->can_cache_brlcks) { 565 if (cinode->can_cache_brlcks) {
567 /* can cache locks - no need to push them */ 566 /* can cache locks - no need to relock */
568 up_write(&cinode->lock_sem); 567 up_read(&cinode->lock_sem);
569 return rc; 568 return rc;
570 } 569 }
571 570
@@ -576,7 +575,7 @@ cifs_relock_file(struct cifsFileInfo *cfile)
576 else 575 else
577 rc = tcon->ses->server->ops->push_mand_locks(cfile); 576 rc = tcon->ses->server->ops->push_mand_locks(cfile);
578 577
579 up_write(&cinode->lock_sem); 578 up_read(&cinode->lock_sem);
580 return rc; 579 return rc;
581} 580}
582 581