2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

shmem: dump shared memory before dumping namespaces

page_ids is a global variable and it is used to dump shared memroy,
process memory and ipc shared memory.

The problem is that an IPC namespace is dumped in a child process,
so page_ids isn't changed in a parent process. This patch is a quick
workaround this issue.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Andrei Vagin
2017-10-14 04:19:35 +03:00
parent 0768d9203f
commit f65517b95d

View File

@@ -1834,6 +1834,16 @@ int cr_dump_tasks(pid_t pid)
if (dump_pstree(root_item))
goto err;
/*
* TODO: cr_dump_shmem has to be called before dump_namespaces(),
* because page_ids is a global variable and it is used to dump
* ipc shared memory, but an ipc namespace is dumped in a child
* process.
*/
ret = cr_dump_shmem();
if (ret)
goto err;
if (root_ns_mask)
if (dump_namespaces(root_item, root_ns_mask) < 0)
goto err;
@@ -1842,10 +1852,6 @@ int cr_dump_tasks(pid_t pid)
if (ret)
goto err;
ret = cr_dump_shmem();
if (ret)
goto err;
ret = fix_external_unix_sockets();
if (ret)
goto err;