mirror of
https://github.com/torvalds/linux.git
synced 2024-12-03 17:41:22 +00:00
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>
This commit is contained in:
parent
8ea00c6977
commit
5079276066
@ -793,6 +793,9 @@ cifs_posix_lock_test(struct file *file, struct file_lock *flock)
|
|||||||
struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode);
|
struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode);
|
||||||
unsigned char saved_type = flock->fl_type;
|
unsigned char saved_type = flock->fl_type;
|
||||||
|
|
||||||
|
if ((flock->fl_flags & FL_POSIX) == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
mutex_lock(&cinode->lock_mutex);
|
mutex_lock(&cinode->lock_mutex);
|
||||||
posix_test_lock(file, flock);
|
posix_test_lock(file, flock);
|
||||||
|
|
||||||
@ -809,12 +812,15 @@ static int
|
|||||||
cifs_posix_lock_set(struct file *file, struct file_lock *flock)
|
cifs_posix_lock_set(struct file *file, struct file_lock *flock)
|
||||||
{
|
{
|
||||||
struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode);
|
struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode);
|
||||||
int rc;
|
int rc = 1;
|
||||||
|
|
||||||
|
if ((flock->fl_flags & FL_POSIX) == 0)
|
||||||
|
return rc;
|
||||||
|
|
||||||
mutex_lock(&cinode->lock_mutex);
|
mutex_lock(&cinode->lock_mutex);
|
||||||
if (!cinode->can_cache_brlcks) {
|
if (!cinode->can_cache_brlcks) {
|
||||||
mutex_unlock(&cinode->lock_mutex);
|
mutex_unlock(&cinode->lock_mutex);
|
||||||
return 1;
|
return rc;
|
||||||
}
|
}
|
||||||
rc = posix_lock_file_wait(file, flock);
|
rc = posix_lock_file_wait(file, flock);
|
||||||
mutex_unlock(&cinode->lock_mutex);
|
mutex_unlock(&cinode->lock_mutex);
|
||||||
|
Loading…
Reference in New Issue
Block a user