Commit 9f9d0e05 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

restore: collect vma-s before creating children (v3)

A private vma's should be inherited by children for
restoring copy-on-write regions.

v2: free parent's vma-s in this patch.
v3: split patch on two parts
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 32650788
...@@ -274,14 +274,9 @@ static int open_vmas(int pid, struct list_head *vmas) ...@@ -274,14 +274,9 @@ static int open_vmas(int pid, struct list_head *vmas)
static int prepare_and_sigreturn(int pid, CoreEntry *core) static int prepare_and_sigreturn(int pid, CoreEntry *core)
{ {
int err, nr_vmas; int err;
LIST_HEAD(vma_list);
err = read_vmas(pid, &vma_list, &nr_vmas); err = open_vmas(pid, &rst_vma_list);
if (err)
return err;
err = open_vmas(pid, &vma_list);
if (err) if (err)
return err; return err;
...@@ -840,6 +835,9 @@ static int restore_task_with_children(void *_arg) ...@@ -840,6 +835,9 @@ static int restore_task_with_children(void *_arg)
exit(1); exit(1);
} }
if (read_vmas(pid))
exit(1);
pr_info("Restoring children:\n"); pr_info("Restoring children:\n");
list_for_each_entry(child, &current->children, sibling) { list_for_each_entry(child, &current->children, sibling) {
if (!restore_before_setsid(child)) if (!restore_before_setsid(child))
......
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