[CRIU] [PATCH 1/3] mount: Relax ext mounts resolving

Pavel Emelyanov xemul at virtuozzo.com
Wed Sep 21 02:59:04 PDT 2016


Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/mount.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/criu/mount.c b/criu/mount.c
index f402f6f..021d041 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -473,6 +473,7 @@ static void mnt_tree_show(struct mount_info *tree, int off)
 	pr_info("%*s<--\n", off, "");
 }
 
+/* Returns -1 on error, 1 if external mount resolved, 0 otherwise */
 static int try_resolve_ext_mount(struct mount_info *info)
 {
 	struct ext_mount *em;
@@ -483,7 +484,7 @@ static int try_resolve_ext_mount(struct mount_info *info)
 		pr_info("Found %s mapping for %s mountpoint\n",
 				em->val, info->mountpoint);
 		info->external = em;
-		return 0;
+		return 1;
 	}
 
 	snprintf(devstr, sizeof(devstr), "dev[%d/%d]",
@@ -507,11 +508,11 @@ static int try_resolve_ext_mount(struct mount_info *info)
 			BUG_ON(info->fstype->code != FSTYPE__AUTO);
 			xfree(info->source);
 			info->source = source;
-			return 0;
+			return 1;
 		}
 	}
 
-	return -ENOTSUP;
+	return 0;
 }
 
 static struct mount_info *find_widest_shared(struct mount_info *m)
@@ -822,13 +823,10 @@ static int resolve_external_mounts(struct mount_info *info)
 			continue;
 
 		ret = try_resolve_ext_mount(m);
-		if (ret < 0 && ret != -ENOTSUP) {
-			return -1;
-		} else if (ret == -ENOTSUP && !ext_ns) {
-			continue;
-		} else if (ret == 0) {
+		if (ret < 0)
+			return ret;
+		if (ret == 1 || !ext_ns)
 			continue;
-		}
 
 		match = find_best_external_match(ext_ns->mnt.mntinfo_list, m);
 		if (!match)
-- 
2.5.0



More information about the CRIU mailing list