[CRIU] [PATCH] mount: change the root master_id on restore only

Andrey Vagin avagin at openvz.org
Thu Dec 24 07:30:01 PST 2015


From: Andrew Vagin <avagin at virtuozzo.com>

We were not going to change it on dump

Cc: Dmitry Safonov <dsafonov at odin.com>
Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 mount.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/mount.c b/mount.c
index cb53fbc..a209ac0 100644
--- a/mount.c
+++ b/mount.c
@@ -902,10 +902,9 @@ static int resolve_external_mounts(struct mount_info *info)
 	return 0;
 }
 
-static int resolve_shared_mounts(struct mount_info *info)
+static int resolve_shared_mounts(struct mount_info *info, int root_master_id)
 {
 	struct mount_info *m, *t;
-	int root_master_id = info->master_id;
 
 	/*
 	 * If we have a shared mounts, both master
@@ -3017,7 +3016,7 @@ static int populate_mnt_ns(void)
 	if (!pms)
 		return -1;
 
-	if (resolve_shared_mounts(mntinfo))
+	if (resolve_shared_mounts(mntinfo, pms->master_id))
 		return -1;
 
 	for (nsid = ns_ids; nsid; nsid = nsid->next) {
@@ -3398,7 +3397,7 @@ int collect_mnt_namespaces(bool for_dump)
 	if (arg.need_to_validate) {
 		ret = -1;
 
-		if (resolve_shared_mounts(mntinfo))
+		if (resolve_shared_mounts(mntinfo, 0))
 			goto err;
 		if (validate_mounts(mntinfo, true))
 			goto err;
-- 
2.4.3



More information about the CRIU mailing list