Commit f65517b9 authored by Andrei Vagin's avatar Andrei Vagin

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: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 0768d920
...@@ -1834,6 +1834,16 @@ int cr_dump_tasks(pid_t pid) ...@@ -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) ...@@ -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;
......
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