diff options
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index eeb8c67a3f29..7193494efc03 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -589,6 +589,7 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease) | |||
589 | /* note that this is called by vfs setlease with the BKL held | 589 | /* note that this is called by vfs setlease with the BKL held |
590 | although I doubt that BKL is needed here in cifs */ | 590 | although I doubt that BKL is needed here in cifs */ |
591 | struct inode *inode = file->f_path.dentry->d_inode; | 591 | struct inode *inode = file->f_path.dentry->d_inode; |
592 | struct cifsFileInfo *cfile = file->private_data; | ||
592 | 593 | ||
593 | if (!(S_ISREG(inode->i_mode))) | 594 | if (!(S_ISREG(inode->i_mode))) |
594 | return -EINVAL; | 595 | return -EINVAL; |
@@ -599,8 +600,7 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease) | |||
599 | ((arg == F_WRLCK) && | 600 | ((arg == F_WRLCK) && |
600 | (CIFS_I(inode)->clientCanCacheAll))) | 601 | (CIFS_I(inode)->clientCanCacheAll))) |
601 | return generic_setlease(file, arg, lease); | 602 | return generic_setlease(file, arg, lease); |
602 | else if (CIFS_SB(inode->i_sb)->tcon->local_lease && | 603 | else if (cfile->tcon->local_lease && !CIFS_I(inode)->clientCanCacheRead) |
603 | !CIFS_I(inode)->clientCanCacheRead) | ||
604 | /* If the server claims to support oplock on this | 604 | /* If the server claims to support oplock on this |
605 | file, then we still need to check oplock even | 605 | file, then we still need to check oplock even |
606 | if the local_lease mount option is set, but there | 606 | if the local_lease mount option is set, but there |