Commit c5054f95 authored by Pavel Emelyanov's avatar Pavel Emelyanov

mnt: Factor out external check in validate_mounts

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 4e027634
...@@ -675,34 +675,28 @@ static int validate_mounts(struct mount_info *info, bool for_dump) ...@@ -675,34 +675,28 @@ static int validate_mounts(struct mount_info *info, bool for_dump)
m->mountpoint, m->s_dev, m->root, m->mnt_id); m->mountpoint, m->s_dev, m->root, m->mnt_id);
return -1; return -1;
} }
} else { } else if (!m->external) {
t = find_fsroot_mount_for(m); t = find_fsroot_mount_for(m);
if (!t) { if (!t) {
int ret; int ret;
if (for_dump) {
/* /*
* We've already resolved the mount * No root-mount found for this bind and it's neither
* and it is external. * marked nor auto-resolved as external one. So last
* chance not to fail is to talk to plugins.
*/ */
if (m->external) {
ret = 0; if (for_dump) {
} else {
ret = run_plugins(DUMP_EXT_MOUNT, m->mountpoint, m->mnt_id); ret = run_plugins(DUMP_EXT_MOUNT, m->mountpoint, m->mnt_id);
if (ret == 0) if (ret == 0)
m->need_plugin = true; m->need_plugin = true;
} } else
} else {
if (m->need_plugin || m->external)
/* /*
* plugin should take care of this one * Plugin should take care of this one
* in restore_ext_mount, or do_bind_mount * in restore_ext_mount, or do_bind_mount
* will mount it as external * will mount it as external
*/ */
ret = 0; ret = m->need_plugin ? 0 : -ENOTSUP;
else
ret = -ENOTSUP;
}
if (ret < 0) { if (ret < 0) {
if (ret == -ENOTSUP) if (ret == -ENOTSUP)
......
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