[CRIU] [PATCH 1/2] mount: Do not fail on shared cr-time mounts mismatch

Kirill Tkhai ktkhai at virtuozzo.com
Fri Sep 23 09:47:00 PDT 2016


Since cr-time mount parent may be shared, and we do
not propagate the mount there, this patch excludes
them from validation.

https://jira.sw.ru/browse/PSBM-52513

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/mount.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/criu/mount.c b/criu/mount.c
index f402f6f..f20c9eb 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -597,7 +597,7 @@ static int validate_shared(struct mount_info *m)
 	list_for_each_entry(ct, &t->children, siblings) {
 		struct mount_info *cm;
 
-		if (ct->is_ns_root)
+		if (ct->is_ns_root || ct->mnt_id == CRTIME_MNT_ID)
 			continue;
 
 		sibling_path = mnt_get_sibling_path(ct, m, buf, sizeof(buf));
@@ -615,8 +615,11 @@ static int validate_shared(struct mount_info *m)
 		list_move(&cm->siblings, &children);
 	}
 
-	if (!list_empty(&m->children))
-		goto err;
+	/* Now all real mounts should be moved */
+	list_for_each_entry(ct, &m->children, siblings) {
+		if (ct->mnt_id != CRTIME_MNT_ID)
+			goto err;
+	}
 
 	list_splice(&children, &m->children);
 	return 0;



More information about the CRIU mailing list