[CRIU] [PATCH] mnt: Allow for external mounts to be fsroot ones

Pavel Emelyanov xemul at parallels.com
Thu Dec 24 04:27:46 PST 2015


Right now if we bind-mount / of some FS into container and want this
to be 'external' mount, criu would refuse to dump this mountpoint.

Tune the check in validate_mounts() to always accept any external mps
regardless of whether they are fsroot or not.

https://github.com/xemul/criu/issues/93

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 mount.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/mount.c b/mount.c
index 7c42608..9a87a95 100644
--- a/mount.c
+++ b/mount.c
@@ -664,6 +664,9 @@ static int validate_mounts(struct mount_info *info, bool for_dump)
 		if (m->shared_id && validate_shared(m))
 			return -1;
 
+		if (m->external)
+			goto skip_fstype;
+
 		/*
 		 * Mountpoint can point to / of an FS. In that case this FS
 		 * should be of some known type so that we can just mount one.
@@ -681,7 +684,7 @@ static int validate_mounts(struct mount_info *info, bool for_dump)
 						m->mountpoint, m->s_dev, m->root, m->mnt_id);
 				return -1;
 			}
-		} else if (!m->external) {
+		} else {
 			t = find_fsroot_mount_for(m);
 			if (!t) {
 				int ret;
@@ -712,7 +715,7 @@ static int validate_mounts(struct mount_info *info, bool for_dump)
 				}
 			}
 		}
-
+skip_fstype:
 		list_for_each_entry(t, &m->parent->children, siblings) {
 			if (m == t)
 				continue;
-- 
1.9.3



More information about the CRIU mailing list