mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
mnt: Fix slave mounts order estimation in can_mount_now
For slave mount we need to make sure that all childrent mountpoints of the master peer is mounted before we can proceed otherwise there gonna be duplicated mountpoints after the restore. https://jira.sw.ru/browse/PSBM-39957 Signed-off-by: Andrew Vagin <avagin@odin.com> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
ad56fb3c81
commit
dfef4e05d5
1 changed files with 17 additions and 5 deletions
22
mount.c
22
mount.c
|
|
@ -2072,8 +2072,23 @@ static bool can_mount_now(struct mount_info *mi)
|
|||
if (mi->external)
|
||||
return true;
|
||||
|
||||
if (mi->master_id && mi->bind == NULL)
|
||||
return false;
|
||||
/*
|
||||
* We're the slave peer:
|
||||
* - Make sure the master peer is already mounted
|
||||
* - Make sure all children is mounted as well to
|
||||
* eliminame mounts duplications
|
||||
*/
|
||||
if (mi->master_id) {
|
||||
struct mount_info *c;
|
||||
|
||||
if (mi->bind == NULL)
|
||||
return false;
|
||||
|
||||
list_for_each_entry(c, &mi->bind->children, siblings) {
|
||||
if (!c->mounted)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!fsroot_mounted(mi) && (mi->bind == NULL && !mi->need_plugin && !mi->external))
|
||||
return false;
|
||||
|
|
@ -2090,9 +2105,6 @@ static bool can_mount_now(struct mount_info *mi)
|
|||
list_for_each_entry(n, &p->mnt_share, mnt_share)
|
||||
if (!n->mounted)
|
||||
return false;
|
||||
list_for_each_entry(n, &p->mnt_slave_list, mnt_slave)
|
||||
if (!n->mounted)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue