aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-09-12 22:15:36 -0400
committerIlya Dryomov <idryomov@gmail.com>2016-10-03 10:13:49 -0400
commitdb4a63aab43b2040292b2023512864702b5f9799 (patch)
tree9197729f9ddb0a5f8f79c7148fe7d359ac00bfce
parente55f1a1871b148802b42ee3807edcb6528ffc27d (diff)
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)
210 if (!(fl->fl_flags & FL_FLOCK)) 210 if (!(fl->fl_flags & FL_FLOCK))
211 return -ENOLCK; 211 return -ENOLCK;
212 /* No mandatory locks */ 212 /* No mandatory locks */
213 if (__mandatory_lock(file->f_mapping->host) && fl->fl_type != F_UNLCK) 213 if (fl->fl_type & LOCK_MAND)
214 return -ENOLCK; 214 return -EOPNOTSUPP;
215 215
216 dout("ceph_flock, fl_file: %p", fl->fl_file); 216 dout("ceph_flock, fl_file: %p", fl->fl_file);
217 217