Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernel Build Daemon <kbuild@suse.de>2019-04-19 07:24:19 +0200
committerKernel Build Daemon <kbuild@suse.de>2019-04-19 07:24:19 +0200
commit13838c049f7363cb5daa754c222e475b8360d557 (patch)
tree6f8683177631c235b8f2cb24f0be4c23295d82d9
parent9dfc249c248584c3c2a9262750998e663807a7a9 (diff)
parent742719ae86c485b485d0904119fbc5d06a5f8d1e (diff)
Merge branch 'SLE15-SP1' into openSUSE-15.1openSUSE-15.1
-rw-r--r--fs/cifs/file.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 66c99fd13ffd..401d58eda8cd 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1629,8 +1629,20 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
rc = server->ops->mand_unlock_range(cfile, flock, xid);
out:
- if (flock->fl_flags & FL_POSIX && !rc)
+ if (flock->fl_flags & FL_POSIX) {
+ /*
+ * If this is a request to remove all locks because we
+ * are closing the file, it doesn't matter if the
+ * unlocking failed as both cifs.ko and the SMB server
+ * remove the lock on file close
+ */
+ if (rc) {
+ cifs_dbg(VFS, "%s failed rc=%d\n", __func__, rc);
+ if (!(flock->fl_flags & FL_CLOSE))
+ return rc;
+ }
rc = locks_lock_file_wait(file, flock);
+ }
return rc;
}