Commit 90e79b74 authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov

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: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 30ecf44f
......@@ -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;
......
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