aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/file.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 91e05f2f0acf..c1f063cd1b0c 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -793,6 +793,9 @@ cifs_posix_lock_test(struct file *file, struct file_lock *flock)
793 struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode); 793 struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode);
794 unsigned char saved_type = flock->fl_type; 794 unsigned char saved_type = flock->fl_type;
795 795
796 if ((flock->fl_flags & FL_POSIX) == 0)
797 return 1;
798
796 mutex_lock(&cinode->lock_mutex); 799 mutex_lock(&cinode->lock_mutex);
797 posix_test_lock(file, flock); 800 posix_test_lock(file, flock);
798 801
@@ -809,12 +812,15 @@ static int
809cifs_posix_lock_set(struct file *file, struct file_lock *flock) 812cifs_posix_lock_set(struct file *file, struct file_lock *flock)
810{ 813{
811 struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode); 814 struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode);
812 int rc; 815 int rc = 1;
816
817 if ((flock->fl_flags & FL_POSIX) == 0)
818 return rc;
813 819
814 mutex_lock(&cinode->lock_mutex); 820 mutex_lock(&cinode->lock_mutex);
815 if (!cinode->can_cache_brlcks) { 821 if (!cinode->can_cache_brlcks) {
816 mutex_unlock(&cinode->lock_mutex); 822 mutex_unlock(&cinode->lock_mutex);
817 return 1; 823 return rc;
818 } 824 }
819 rc = posix_lock_file_wait(file, flock); 825 rc = posix_lock_file_wait(file, flock);
820 mutex_unlock(&cinode->lock_mutex); 826 mutex_unlock(&cinode->lock_mutex);