Commit 8bd7ac77 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

mounts: restero slave, shared mounts correctly

If a mount is slave and it has a shared group. crtools must convert it
in slave and only than crtools can make it shared.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f0e99650
......@@ -921,14 +921,14 @@ static int restore_shared_options(struct mount_info *mi, bool private, bool shar
pr_perror("Unable to make %s private", mi->mountpoint);
return -1;
}
if (shared && mount(NULL, mi->mountpoint, NULL, MS_SHARED, NULL)) {
pr_perror("Unable to make %s shared", mi->mountpoint);
return -1;
}
if (slave && mount(NULL, mi->mountpoint, NULL, MS_SLAVE, NULL)) {
pr_perror("Unable to make %s slave", mi->mountpoint);
return -1;
}
if (shared && mount(NULL, mi->mountpoint, NULL, MS_SHARED, NULL)) {
pr_perror("Unable to make %s shared", mi->mountpoint);
return -1;
}
return 0;
}
......@@ -1124,7 +1124,7 @@ static int do_bind_mount(struct mount_info *mi)
* shared - the mount is in the same shared group with mi->bind
* mi->shared_id && !shared - create a new shared group
*/
if (restore_shared_options(mi, !shared,
if (restore_shared_options(mi, !shared && !mi->master_id,
mi->shared_id && !shared,
mi->master_id))
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