Commit 6079c509 authored by Stanislav Kinsbursky's avatar Stanislav Kinsbursky Committed by Cyrill Gorcunov

checkpoint: switch namespaces before collect stage

Cleanup patch.
Signed-off-by: 's avatarStanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent f054b382
...@@ -102,15 +102,11 @@ static int collect_ipc_tun(struct ipc_ns_entry *e) ...@@ -102,15 +102,11 @@ static int collect_ipc_tun(struct ipc_ns_entry *e)
return ipc_sysctl_req(e, CTL_READ); return ipc_sysctl_req(e, CTL_READ);
} }
static int collect_ipc_data(int ns_pid, struct ipc_ns_data *ipc) static int collect_ipc_data(struct ipc_ns_data *ipc)
{ {
int fd, ret; int fd, ret;
struct ipc_ns_entry *entry = &ipc->entry; struct ipc_ns_entry *entry = &ipc->entry;
ret = switch_ns(ns_pid, CLONE_NEWIPC, "ipc");
if (ret < 0)
return ret;
entry->in_use[IPC_MSG_IDS] = ret = collect_ipc_msg(NULL); entry->in_use[IPC_MSG_IDS] = ret = collect_ipc_msg(NULL);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -144,7 +140,11 @@ int dump_ipc_ns(int ns_pid, struct cr_fdset *fdset) ...@@ -144,7 +140,11 @@ int dump_ipc_ns(int ns_pid, struct cr_fdset *fdset)
int fd, ret; int fd, ret;
struct ipc_ns_data ipc; struct ipc_ns_data ipc;
ret = collect_ipc_data(ns_pid, &ipc); ret = switch_ns(ns_pid, CLONE_NEWIPC, "ipc");
if (ret < 0)
return ret;
ret = collect_ipc_data(&ipc);
if (ret < 0) { if (ret < 0) {
pr_err("Failed to collect IPC namespace data\n"); pr_err("Failed to collect IPC namespace data\n");
return ret; return ret;
......
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