From b41a3fa5a0009cd90764ae79fa129c79282ca40b Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Sat, 29 Oct 2011 17:17:57 +0400 Subject: [PATCH] --- yaml --- r: 273542 b: refs/heads/master c: 5079276066cc421b48a6a63a54a34775979e8506 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/cifs/file.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 5dea47a0209c..9eef94b7d619 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8ea00c6977d8b1463ee86d6689c8ef35ee2529a0 +refs/heads/master: 5079276066cc421b48a6a63a54a34775979e8506 diff --git a/trunk/fs/cifs/file.c b/trunk/fs/cifs/file.c index 91e05f2f0acf..c1f063cd1b0c 100644 --- a/trunk/fs/cifs/file.c +++ b/trunk/fs/cifs/file.c @@ -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); unsigned char saved_type = flock->fl_type; + if ((flock->fl_flags & FL_POSIX) == 0) + return 1; + mutex_lock(&cinode->lock_mutex); posix_test_lock(file, flock); @@ -809,12 +812,15 @@ static int cifs_posix_lock_set(struct file *file, struct file_lock *flock) { 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); if (!cinode->can_cache_brlcks) { mutex_unlock(&cinode->lock_mutex); - return 1; + return rc; } rc = posix_lock_file_wait(file, flock); mutex_unlock(&cinode->lock_mutex);