summaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorJeff Layton2014-08-09 16:16:44 +0200
committerSteve French2014-08-16 06:01:52 +0200
commit024408062b21af7316221c420ff16bdaac478fa8 (patch)
treec2f521ad6627e7c509ca2905012d915340976353 /fs/cifs/cifsfs.c
parentCleanup sparse file support by creating worker function for it (diff)
downloadkernel-qcow2-linux-024408062b21af7316221c420ff16bdaac478fa8.tar.gz
kernel-qcow2-linux-024408062b21af7316221c420ff16bdaac478fa8.tar.xz
kernel-qcow2-linux-024408062b21af7316221c420ff16bdaac478fa8.zip
cifs: handle lease F_UNLCK requests properly
Currently any F_UNLCK request for a lease just gets back -EAGAIN. Allow them to go immediately to generic_setlease instead. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-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)
if (!(S_ISREG(inode->i_mode)))
return -EINVAL;
- /* check if file is oplocked */
- if (((arg == F_RDLCK) && CIFS_CACHE_READ(CIFS_I(inode))) ||
+ /* Check if file is oplocked if this is request for new lease */
+ if (arg == F_UNLCK ||
+ ((arg == F_RDLCK) && CIFS_CACHE_READ(CIFS_I(inode))) ||
((arg == F_WRLCK) && CIFS_CACHE_WRITE(CIFS_I(inode))))
return generic_setlease(file, arg, lease);
else if (tlink_tcon(cfile->tlink)->local_lease &&