Commit cfc267a2 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

mount: restore a shared group for propagated mounts

When a mount is propagated, the result mount is always shared.
If we want to get a private mount, we need to convert it.

Cc: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 5287540e
...@@ -2155,6 +2155,14 @@ static int propagate_mount(struct mount_info *mi) ...@@ -2155,6 +2155,14 @@ static int propagate_mount(struct mount_info *mi)
list_for_each_entry(c, &t->children, siblings) { list_for_each_entry(c, &t->children, siblings) {
if (mounts_equal(mi, c)) { if (mounts_equal(mi, c)) {
pr_debug("\t\tPropagate %s\n", c->mountpoint); pr_debug("\t\tPropagate %s\n", c->mountpoint);
/*
* When a mount is propagated, the result mount
* is always shared. If we want to get a private
* mount, we need to convert it.
*/
restore_shared_options(c, !c->shared_id, 0, 0);
c->mounted = true; c->mounted = true;
propagate_siblings(c); propagate_siblings(c);
umount_from_slaves(c); umount_from_slaves(c);
......
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