mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
mnt: remember to restore MS_UNBINDABLE
Note that if the root is unbindable then restore will fail because cr_pivot_root() tries to bind mount the put dir. If this is a case we want to support, we may want to rearrange how this code is called. Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
30ecf44f48
commit
90e79b741c
1 changed files with 7 additions and 0 deletions
7
mount.c
7
mount.c
|
|
@ -1717,6 +1717,13 @@ static int restore_shared_options(struct mount_info *mi, bool private, bool shar
|
|||
pr_debug("%d:%s private %d shared %d slave %d\n",
|
||||
mi->mnt_id, mi->mountpoint, private, shared, slave);
|
||||
|
||||
if (mi->flags & MS_UNBINDABLE) {
|
||||
if (shared || slave)
|
||||
pr_warn("%s has both unbindable and sharing, ignoring unbindable\n", mi->mountpoint);
|
||||
else
|
||||
return mount(NULL, mi->mountpoint, NULL, MS_UNBINDABLE, NULL);
|
||||
}
|
||||
|
||||
if (private && mount(NULL, mi->mountpoint, NULL, MS_PRIVATE, NULL)) {
|
||||
pr_perror("Unable to make %s private", mi->mountpoint);
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue