mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 15:25:21 +00:00
mount: use per-namespace mntinfo_tree (v2)
This patch removes the global mntinfo_tree and collect_mount_info where it was constructed. The mntinfo list is filled from dump_mnt_ns, rst_collect_local_mntns, collect_mnt_namespaces and read_mnt_ns_img. A mountinfo entry contains a reference on a proper ns_id entry, so we cau use mnt_id to look up a proper mount namespace. v2: remove trash after rebasing. Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
03c69251ab
commit
2f4be997b6
13
sk-unix.c
13
sk-unix.c
@@ -25,6 +25,8 @@
|
||||
#include "mount.h"
|
||||
#include "cr-service.h"
|
||||
#include "plugin.h"
|
||||
#include "namespaces.h"
|
||||
#include "pstree.h"
|
||||
|
||||
#include "protobuf.h"
|
||||
#include "protobuf/sk-unix.pb-c.h"
|
||||
@@ -366,8 +368,16 @@ static int unix_collect_one(const struct unix_diag_msg *m,
|
||||
{
|
||||
struct unix_sk_desc *d;
|
||||
char *name = NULL;
|
||||
struct ns_id *ns;
|
||||
int ret = 0;
|
||||
|
||||
ns = lookup_ns_by_id(root_item->ids->mnt_ns_id, &mnt_ns_desc);
|
||||
if (ns == NULL)
|
||||
return -1;
|
||||
|
||||
if (mntns_collect_root(ns->pid) < 0)
|
||||
return -1;
|
||||
|
||||
d = xzalloc(sizeof(*d));
|
||||
if (!d)
|
||||
return -1;
|
||||
@@ -432,7 +442,8 @@ static int unix_collect_one(const struct unix_diag_msg *m,
|
||||
name, m->udiag_ino);
|
||||
drop_path = true;
|
||||
} else if ((st.st_ino != uv->udiag_vfs_ino) ||
|
||||
!phys_stat_dev_match(st.st_dev, uv->udiag_vfs_dev, name)) {
|
||||
!phys_stat_dev_match(ns->mnt.mntinfo_tree, st.st_dev,
|
||||
uv->udiag_vfs_dev, name)) {
|
||||
pr_info("unix: Dropping path %s for "
|
||||
"unlinked bound "
|
||||
"sk %#x.%#x real %#x.%#x\n",
|
||||
|
Reference in New Issue
Block a user