From db4a63aab43b2040292b2023512864702b5f9799 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Tue, 13 Sep 2016 10:15:36 +0800 Subject: [PATCH] ceph: fix mandatory flock check Signed-off-by: Yan, Zheng --- fs/ceph/locks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c index a2cb0c2..6806dbe 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); -- 2.7.4