aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/locks.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/locks.c')
-rw-r--r--fs/ceph/locks.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c
index 133e0063da64..f91a569a20fb 100644
--- a/fs/ceph/locks.c
+++ b/fs/ceph/locks.c
@@ -87,6 +87,12 @@ int ceph_lock(struct file *file, int cmd, struct file_lock *fl)
87 u8 wait = 0; 87 u8 wait = 0;
88 u16 op = CEPH_MDS_OP_SETFILELOCK; 88 u16 op = CEPH_MDS_OP_SETFILELOCK;
89 89
90 if (!(fl->fl_flags & FL_POSIX))
91 return -ENOLCK;
92 /* No mandatory locks */
93 if (__mandatory_lock(file->f_mapping->host) && fl->fl_type != F_UNLCK)
94 return -ENOLCK;
95
90 fl->fl_nspid = get_pid(task_tgid(current)); 96 fl->fl_nspid = get_pid(task_tgid(current));
91 dout("ceph_lock, fl_pid:%d", fl->fl_pid); 97 dout("ceph_lock, fl_pid:%d", fl->fl_pid);
92 98
@@ -133,6 +139,12 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl)
133 int err; 139 int err;
134 u8 wait = 0; 140 u8 wait = 0;
135 141
142 if (!(fl->fl_flags & FL_FLOCK))
143 return -ENOLCK;
144 /* No mandatory locks */
145 if (__mandatory_lock(file->f_mapping->host) && fl->fl_type != F_UNLCK)
146 return -ENOLCK;
147
136 fl->fl_nspid = get_pid(task_tgid(current)); 148 fl->fl_nspid = get_pid(task_tgid(current));
137 dout("ceph_flock, fl_pid:%d", fl->fl_pid); 149 dout("ceph_flock, fl_pid:%d", fl->fl_pid);
138 150