mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 06:45:35 +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:
@@ -1834,6 +1834,16 @@ int cr_dump_tasks(pid_t pid)
|
|||||||
if (dump_pstree(root_item))
|
if (dump_pstree(root_item))
|
||||||
goto err;
|
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 (root_ns_mask)
|
||||||
if (dump_namespaces(root_item, root_ns_mask) < 0)
|
if (dump_namespaces(root_item, root_ns_mask) < 0)
|
||||||
goto err;
|
goto err;
|
||||||
@@ -1842,10 +1852,6 @@ int cr_dump_tasks(pid_t pid)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
ret = cr_dump_shmem();
|
|
||||||
if (ret)
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
ret = fix_external_unix_sockets();
|
ret = fix_external_unix_sockets();
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
Reference in New Issue
Block a user