Blame 0173-mount-allow-nested-mount-namespaces-with-different-r.patch

Radostin Stoyanov 99fccb2
From 009877169d13f9d6437fc2d11113bccdbad6b15f Mon Sep 17 00:00:00 2001
Radostin Stoyanov 99fccb2
From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Radostin Stoyanov 99fccb2
Date: Mon, 27 Apr 2020 18:24:54 +0300
Radostin Stoyanov 99fccb2
Subject: [PATCH 173/245] mount: allow nested mount namespaces with different
Radostin Stoyanov 99fccb2
 roots
Radostin Stoyanov 99fccb2
Radostin Stoyanov 99fccb2
Only root in root-mntns is special (see rst_mnt_is_root) all other
Radostin Stoyanov 99fccb2
mounts are mounted regulary there is no difference between ns root and
Radostin Stoyanov 99fccb2
any other mount or bind-mount.
Radostin Stoyanov 99fccb2
Radostin Stoyanov 99fccb2
Cherry-picked from Virtuozzo criu:
Radostin Stoyanov 99fccb2
https://src.openvz.org/projects/OVZ/repos/criu/commits/f41e41dd5
Radostin Stoyanov 99fccb2
Radostin Stoyanov 99fccb2
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Radostin Stoyanov 99fccb2
---
Radostin Stoyanov 99fccb2
 criu/mount.c | 11 -----------
Radostin Stoyanov 99fccb2
 1 file changed, 11 deletions(-)
Radostin Stoyanov 99fccb2
Radostin Stoyanov 99fccb2
diff --git a/criu/mount.c b/criu/mount.c
Radostin Stoyanov 99fccb2
index 5591bb67c..97a903934 100644
Radostin Stoyanov 99fccb2
--- a/criu/mount.c
Radostin Stoyanov 99fccb2
+++ b/criu/mount.c
Radostin Stoyanov 99fccb2
@@ -3362,7 +3362,6 @@ void fini_restore_mntns(void)
Radostin Stoyanov 99fccb2
 
Radostin Stoyanov 99fccb2
 static int merge_mount_trees(struct mount_info *root_yard)
Radostin Stoyanov 99fccb2
 {
Radostin Stoyanov 99fccb2
-	struct mount_info *first = NULL;
Radostin Stoyanov 99fccb2
 	struct ns_id *nsid;
Radostin Stoyanov 99fccb2
 
Radostin Stoyanov 99fccb2
 	/* Merge mount trees together under root_yard */
Radostin Stoyanov 99fccb2
@@ -3374,16 +3373,6 @@ static int merge_mount_trees(struct mount_info *root_yard)
Radostin Stoyanov 99fccb2
 
Radostin Stoyanov 99fccb2
 		root = nsid->mnt.mntinfo_tree;
Radostin Stoyanov 99fccb2
 
Radostin Stoyanov 99fccb2
-		if (!first)
Radostin Stoyanov 99fccb2
-			first = root;
Radostin Stoyanov 99fccb2
-		else if (!mounts_sb_equal(root, first) || strcmp(root->root, first->root)) {
Radostin Stoyanov 99fccb2
-			pr_err("Nested mount namespaces with different "
Radostin Stoyanov 99fccb2
-			       "roots %d (@%s %s) %d (@%s %s) are not supported yet\n",
Radostin Stoyanov 99fccb2
-			       root->mnt_id, root->mountpoint, root->root, first->mnt_id, first->mountpoint,
Radostin Stoyanov 99fccb2
-			       first->root);
Radostin Stoyanov 99fccb2
-			return -1;
Radostin Stoyanov 99fccb2
-		}
Radostin Stoyanov 99fccb2
-
Radostin Stoyanov 99fccb2
 		pr_debug("Mountpoint %d (@%s) moved to the root yard\n", root->mnt_id, root->mountpoint);
Radostin Stoyanov 99fccb2
 		root->parent = root_yard;
Radostin Stoyanov 99fccb2
 		list_add(&root->siblings, &root_yard->children);
Radostin Stoyanov 99fccb2
-- 
Radostin Stoyanov 99fccb2
2.35.1
Radostin Stoyanov 99fccb2