aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 4c144c1f50eb..2a6d20c0ce02 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1645,8 +1645,20 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
1645 rc = server->ops->mand_unlock_range(cfile, flock, xid); 1645 rc = server->ops->mand_unlock_range(cfile, flock, xid);
1646 1646
1647out: 1647out:
1648 if (flock->fl_flags & FL_POSIX && !rc) 1648 if (flock->fl_flags & FL_POSIX) {
1649 /*
1650 * If this is a request to remove all locks because we
1651 * are closing the file, it doesn't matter if the
1652 * unlocking failed as both cifs.ko and the SMB server
1653 * remove the lock on file close
1654 */
1655 if (rc) {
1656 cifs_dbg(VFS, "%s failed rc=%d\n", __func__, rc);
1657 if (!(flock->fl_flags & FL_CLOSE))
1658 return rc;
1659 }
1649 rc = locks_lock_file_wait(file, flock); 1660 rc = locks_lock_file_wait(file, flock);
1661 }
1650 return rc; 1662 return rc;
1651} 1663}
1652 1664