Commit 13a8e60b authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

cr-dump: collect mount points in the target namespace

Information about mount points is used for dumping fanotify.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 18dee445
...@@ -1570,7 +1570,7 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts) ...@@ -1570,7 +1570,7 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
if (collect_file_locks(opts)) if (collect_file_locks(opts))
goto err; goto err;
if (collect_mount_info()) if (collect_mount_info(pid))
goto err; goto err;
if (mntns_collect_root(root_item->pid.real)) if (mntns_collect_root(root_item->pid.real))
......
...@@ -1091,7 +1091,7 @@ static int restore_task_with_children(void *_arg) ...@@ -1091,7 +1091,7 @@ static int restore_task_with_children(void *_arg)
/* Restore root task */ /* Restore root task */
if (current->parent == NULL) { if (current->parent == NULL) {
if (collect_mount_info()) if (collect_mount_info(getpid()))
exit(1); exit(1);
if (prepare_namespace(current->pid.virt, ca->clone_flags)) if (prepare_namespace(current->pid.virt, ca->clone_flags))
......
...@@ -7,7 +7,7 @@ int mntns_collect_root(pid_t pid); ...@@ -7,7 +7,7 @@ int mntns_collect_root(pid_t pid);
struct proc_mountinfo; struct proc_mountinfo;
extern int open_mount(unsigned int s_dev); 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); extern struct fstype *find_fstype_by_name(char *fst);
struct cr_fdset; struct cr_fdset;
......
...@@ -37,11 +37,11 @@ int open_mount(unsigned int s_dev) ...@@ -37,11 +37,11 @@ int open_mount(unsigned int s_dev)
return -ENOENT; return -ENOENT;
} }
int collect_mount_info(void) int collect_mount_info(pid_t pid)
{ {
pr_info("Collecting mountinfo\n"); pr_info("Collecting mountinfo\n");
mntinfo = parse_mountinfo(getpid()); mntinfo = parse_mountinfo(pid);
if (!mntinfo) { if (!mntinfo) {
pr_err("Parsing mountinfo %d failed\n", getpid()); pr_err("Parsing mountinfo %d failed\n", getpid());
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment