Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
eb70c0ce
Commit
eb70c0ce
authored
Mar 04, 2014
by
Yan, Zheng
Committed by
Sage Weil
Apr 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceph: forbid mandatory file lock
Signed-off-by:
Yan, Zheng
<
zheng.z.yan@intel.com
>
parent
0e8e95d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
fs/ceph/locks.c
fs/ceph/locks.c
+12
-0
No files found.
fs/ceph/locks.c
View file @
eb70c0ce
...
...
@@ -87,6 +87,12 @@ int ceph_lock(struct file *file, int cmd, struct file_lock *fl)
u8
wait
=
0
;
u16
op
=
CEPH_MDS_OP_SETFILELOCK
;
if
(
!
(
fl
->
fl_flags
&
FL_POSIX
))
return
-
ENOLCK
;
/* No mandatory locks */
if
(
__mandatory_lock
(
file
->
f_mapping
->
host
)
&&
fl
->
fl_type
!=
F_UNLCK
)
return
-
ENOLCK
;
fl
->
fl_nspid
=
get_pid
(
task_tgid
(
current
));
dout
(
"ceph_lock, fl_pid:%d"
,
fl
->
fl_pid
);
...
...
@@ -133,6 +139,12 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl)
int
err
;
u8
wait
=
0
;
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
;
fl
->
fl_nspid
=
get_pid
(
task_tgid
(
current
));
dout
(
"ceph_flock, fl_pid:%d"
,
fl
->
fl_pid
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment