diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 460d87b7cda0..fae765dac934 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -835,13 +835,21 @@ cifs_posix_lock_set(struct file *file, struct file_lock *flock) | |||
835 | if ((flock->fl_flags & FL_POSIX) == 0) | 835 | if ((flock->fl_flags & FL_POSIX) == 0) |
836 | return rc; | 836 | return rc; |
837 | 837 | ||
838 | try_again: | ||
838 | mutex_lock(&cinode->lock_mutex); | 839 | mutex_lock(&cinode->lock_mutex); |
839 | if (!cinode->can_cache_brlcks) { | 840 | if (!cinode->can_cache_brlcks) { |
840 | mutex_unlock(&cinode->lock_mutex); | 841 | mutex_unlock(&cinode->lock_mutex); |
841 | return rc; | 842 | return rc; |
842 | } | 843 | } |
843 | rc = posix_lock_file_wait(file, flock); | 844 | |
845 | rc = posix_lock_file(file, flock, NULL); | ||
844 | mutex_unlock(&cinode->lock_mutex); | 846 | mutex_unlock(&cinode->lock_mutex); |
847 | if (rc == FILE_LOCK_DEFERRED) { | ||
848 | rc = wait_event_interruptible(flock->fl_wait, !flock->fl_next); | ||
849 | if (!rc) | ||
850 | goto try_again; | ||
851 | locks_delete_block(flock); | ||
852 | } | ||
845 | return rc; | 853 | return rc; |
846 | } | 854 | } |
847 | 855 | ||