Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
57c7826a
Commit
57c7826a
authored
Sep 02, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
locks: Check for --file-locks option when real locks are found
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
b6e3223a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
30 deletions
+7
-30
cr-dump.c
cr-dump.c
+1
-30
file-lock.c
file-lock.c
+6
-0
No files found.
cr-dump.c
View file @
57c7826a
...
@@ -1087,36 +1087,7 @@ err:
...
@@ -1087,36 +1087,7 @@ err:
static
int
collect_file_locks
(
void
)
static
int
collect_file_locks
(
void
)
{
{
if
(
parse_file_locks
())
return
parse_file_locks
();
return
-
1
;
if
(
opts
.
handle_file_locks
)
/*
* If the handle file locks option(-l) is set,
* collect work is over.
*/
return
0
;
/*
* If the handle file locks option is not set, we need to do
* the check, any file locks hold by tasks in our pstree is
* not allowed.
*
* It's hard to do it carefully, there might be some other
* issues like tasks beyond pstree would use flocks hold by
* dumping tasks, but we can't know it in dumping time.
* We need to make sure these flocks only used by dumping tasks.
* We might have to do the check that this option would only
* be used by container dumping.
*/
if
(
!
list_empty
(
&
file_lock_list
))
{
pr_err
(
"Some file locks are hold by dumping tasks!"
"You can try --"
OPT_FILE_LOCKS
" to dump them.
\n
"
);
return
-
1
;
}
return
0
;
}
}
static
int
dump_task_thread
(
struct
parasite_ctl
*
parasite_ctl
,
static
int
dump_task_thread
(
struct
parasite_ctl
*
parasite_ctl
,
...
...
file-lock.c
View file @
57c7826a
...
@@ -169,6 +169,12 @@ int note_file_lock(struct pid *pid, int fd, int lfd, struct fd_parms *p)
...
@@ -169,6 +169,12 @@ int note_file_lock(struct pid *pid, int fd, int lfd, struct fd_parms *p)
if
(
!
lock_file_match
(
fl
,
p
))
if
(
!
lock_file_match
(
fl
,
p
))
continue
;
continue
;
if
(
!
opts
.
handle_file_locks
)
{
pr_err
(
"Some file locks are hold by dumping tasks!"
"You can try --"
OPT_FILE_LOCKS
" to dump them.
\n
"
);
return
-
1
;
}
if
(
fl
->
fl_kind
==
FL_POSIX
)
{
if
(
fl
->
fl_kind
==
FL_POSIX
)
{
/*
/*
* POSIX locks cannot belong to anyone
* POSIX locks cannot belong to anyone
...
...
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