Commit 8ccdb649 authored by Pavel Emelyanov's avatar Pavel Emelyanov

mount: Relax ext mounts resolving

Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent fbaa9185
...@@ -474,6 +474,7 @@ static void mnt_tree_show(struct mount_info *tree, int off) ...@@ -474,6 +474,7 @@ static void mnt_tree_show(struct mount_info *tree, int off)
pr_info("%*s<--\n", 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) static int try_resolve_ext_mount(struct mount_info *info)
{ {
struct ext_mount *em; struct ext_mount *em;
...@@ -484,7 +485,7 @@ static int try_resolve_ext_mount(struct mount_info *info) ...@@ -484,7 +485,7 @@ static int try_resolve_ext_mount(struct mount_info *info)
pr_info("Found %s mapping for %s mountpoint\n", pr_info("Found %s mapping for %s mountpoint\n",
em->val, info->mountpoint); em->val, info->mountpoint);
info->external = em; info->external = em;
return 0; return 1;
} }
snprintf(devstr, sizeof(devstr), "dev[%d/%d]", snprintf(devstr, sizeof(devstr), "dev[%d/%d]",
...@@ -508,11 +509,11 @@ static int try_resolve_ext_mount(struct mount_info *info) ...@@ -508,11 +509,11 @@ static int try_resolve_ext_mount(struct mount_info *info)
BUG_ON(info->fstype->code != FSTYPE__AUTO); BUG_ON(info->fstype->code != FSTYPE__AUTO);
xfree(info->source); xfree(info->source);
info->source = source; info->source = source;
return 0; return 1;
} }
} }
return -ENOTSUP; return 0;
} }
static struct mount_info *find_widest_shared(struct mount_info *m) static struct mount_info *find_widest_shared(struct mount_info *m)
...@@ -823,13 +824,10 @@ static int resolve_external_mounts(struct mount_info *info) ...@@ -823,13 +824,10 @@ static int resolve_external_mounts(struct mount_info *info)
continue; continue;
ret = try_resolve_ext_mount(m); ret = try_resolve_ext_mount(m);
if (ret < 0 && ret != -ENOTSUP) { if (ret < 0)
return -1; return ret;
} else if (ret == -ENOTSUP && !ext_ns) { if (ret == 1 || !ext_ns)
continue;
} else if (ret == 0) {
continue; continue;
}
match = find_best_external_match(ext_ns->mnt.mntinfo_list, m); match = find_best_external_match(ext_ns->mnt.mntinfo_list, m);
if (!match) if (!match)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment