diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2011-10-29 09:17:57 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2011-10-29 23:03:14 -0400 |
commit | 5079276066cc421b48a6a63a54a34775979e8506 (patch) | |
tree | e24d9df48c301023532945a67b476bedf4d27a36 /fs/cifs/file.c | |
parent | 8ea00c6977d8b1463ee86d6689c8ef35ee2529a0 (diff) |
CIFS: Fix the VFS brlock cache usage in posix locking case
Request to the cache in FL_POSIX case only.
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 10 |
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 | |||
809 | cifs_posix_lock_set(struct file *file, struct file_lock *flock) | 812 | cifs_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); |