diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index ea096ce5d4f7..c1f063cd1b0c 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -778,7 +778,6 @@ try_again: | |||
778 | else { | 778 | else { |
779 | mutex_lock(&cinode->lock_mutex); | 779 | mutex_lock(&cinode->lock_mutex); |
780 | list_del_init(&lock->blist); | 780 | list_del_init(&lock->blist); |
781 | mutex_unlock(&cinode->lock_mutex); | ||
782 | } | 781 | } |
783 | } | 782 | } |
784 | 783 | ||
@@ -794,6 +793,9 @@ cifs_posix_lock_test(struct file *file, struct file_lock *flock) | |||
794 | struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode); | 793 | struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode); |
795 | unsigned char saved_type = flock->fl_type; | 794 | unsigned char saved_type = flock->fl_type; |
796 | 795 | ||
796 | if ((flock->fl_flags & FL_POSIX) == 0) | ||
797 | return 1; | ||
798 | |||
797 | mutex_lock(&cinode->lock_mutex); | 799 | mutex_lock(&cinode->lock_mutex); |
798 | posix_test_lock(file, flock); | 800 | posix_test_lock(file, flock); |
799 | 801 | ||
@@ -810,12 +812,15 @@ static int | |||
810 | cifs_posix_lock_set(struct file *file, struct file_lock *flock) | 812 | cifs_posix_lock_set(struct file *file, struct file_lock *flock) |
811 | { | 813 | { |
812 | struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode); | 814 | struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode); |
813 | int rc; | 815 | int rc = 1; |
816 | |||
817 | if ((flock->fl_flags & FL_POSIX) == 0) | ||
818 | return rc; | ||
814 | 819 | ||
815 | mutex_lock(&cinode->lock_mutex); | 820 | mutex_lock(&cinode->lock_mutex); |
816 | if (!cinode->can_cache_brlcks) { | 821 | if (!cinode->can_cache_brlcks) { |
817 | mutex_unlock(&cinode->lock_mutex); | 822 | mutex_unlock(&cinode->lock_mutex); |
818 | return 1; | 823 | return rc; |
819 | } | 824 | } |
820 | rc = posix_lock_file_wait(file, flock); | 825 | rc = posix_lock_file_wait(file, flock); |
821 | mutex_unlock(&cinode->lock_mutex); | 826 | mutex_unlock(&cinode->lock_mutex); |