summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-09-13 04:15:36 +0200
committerIlya Dryomov <idryomov@gmail.com>2016-10-03 16:13:49 +0200
commitdb4a63aab43b2040292b2023512864702b5f9799 (patch)
tree9197729f9ddb0a5f8f79c7148fe7d359ac00bfce
parentceph: remove warning when ceph_releasepage() is called on dirty page (diff)
downloadlinux-db4a63aab43b2040292b2023512864702b5f9799.tar.xz
linux-db4a63aab43b2040292b2023512864702b5f9799.zip
ceph: fix mandatory flock check
Signed-off-by: Yan, Zheng <zyan@redhat.com>
-rw-r--r--fs/ceph/locks.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c
index a2cb0c254060..6806dbeaee19 100644
--- a/fs/ceph/locks.c
+++ b/fs/ceph/locks.c
@@ -210,8 +210,8 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl)
if (!(fl->fl_flags & FL_FLOCK))
return -ENOLCK;
/* No mandatory locks */
- if (__mandatory_lock(file->f_mapping->host) && fl->fl_type != F_UNLCK)
- return -ENOLCK;
+ if (fl->fl_type & LOCK_MAND)
+ return -EOPNOTSUPP;
dout("ceph_flock, fl_file: %p", fl->fl_file);