[CRIU] [PATCH 1/2] cr-dump: collect mount points in the target namespace
Andrey Vagin
avagin at openvz.org
Fri Apr 5 18:15:41 EDT 2013
Information about mount points is used for dumping fanotify.
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
cr-dump.c | 2 +-
cr-restore.c | 2 +-
include/mount.h | 2 +-
mount.c | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/cr-dump.c b/cr-dump.c
index f11bfcc..9b878ed 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -1568,7 +1568,7 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
if (collect_file_locks(opts))
goto err;
- if (collect_mount_info())
+ if (collect_mount_info(pid))
goto err;
if (mntns_collect_root(root_item->pid.real))
diff --git a/cr-restore.c b/cr-restore.c
index 48b441b..48ad448 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -1091,7 +1091,7 @@ static int restore_task_with_children(void *_arg)
/* Restore root task */
if (current->parent == NULL) {
- if (collect_mount_info())
+ if (collect_mount_info(getpid()))
exit(1);
if (prepare_namespace(current->pid.virt, ca->clone_flags))
diff --git a/include/mount.h b/include/mount.h
index f7c096d..3627dac 100644
--- a/include/mount.h
+++ b/include/mount.h
@@ -7,7 +7,7 @@ int mntns_collect_root(pid_t pid);
struct proc_mountinfo;
extern int open_mount(unsigned int s_dev);
-extern int collect_mount_info(void);
+extern int collect_mount_info(pid_t pid);
extern struct fstype *find_fstype_by_name(char *fst);
struct cr_fdset;
diff --git a/mount.c b/mount.c
index 97a31e4..dd271f1 100644
--- a/mount.c
+++ b/mount.c
@@ -37,11 +37,11 @@ int open_mount(unsigned int s_dev)
return -ENOENT;
}
-int collect_mount_info(void)
+int collect_mount_info(pid_t pid)
{
pr_info("Collecting mountinfo\n");
- mntinfo = parse_mountinfo(getpid());
+ mntinfo = parse_mountinfo(pid);
if (!mntinfo) {
pr_err("Parsing mountinfo %d failed\n", getpid());
return -1;
--
1.7.11.7
More information about the CRIU
mailing list