aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/cifsfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 888398067420..0a4a4d7d407e 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -812,8 +812,9 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
812 if (!(S_ISREG(inode->i_mode))) 812 if (!(S_ISREG(inode->i_mode)))
813 return -EINVAL; 813 return -EINVAL;
814 814
815 /* check if file is oplocked */ 815 /* Check if file is oplocked if this is request for new lease */
816 if (((arg == F_RDLCK) && CIFS_CACHE_READ(CIFS_I(inode))) || 816 if (arg == F_UNLCK ||
817 ((arg == F_RDLCK) && CIFS_CACHE_READ(CIFS_I(inode))) ||
817 ((arg == F_WRLCK) && CIFS_CACHE_WRITE(CIFS_I(inode)))) 818 ((arg == F_WRLCK) && CIFS_CACHE_WRITE(CIFS_I(inode))))
818 return generic_setlease(file, arg, lease); 819 return generic_setlease(file, arg, lease);
819 else if (tlink_tcon(cfile->tlink)->local_lease && 820 else if (tlink_tcon(cfile->tlink)->local_lease &&