Commit 3ef1b53e authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Pavel Emelyanov

do_new_mount() should clear all do_change_type() bits

do_new_mount() clears MS_SHARED but this is not enough. It should clear
all bits processed in restore_shared_options().

The patch also adds MS_UNBINDABLE to MS_CHANGE_TYPE_MASK even if it is
not currently used. Just to match the kernel's do_change_type() check.
Signed-off-by: 's avatarOleg Nesterov <oleg@redhat.com>
Acked-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent b0115358
...@@ -1759,6 +1759,9 @@ skip_parent: ...@@ -1759,6 +1759,9 @@ skip_parent:
return 0; return 0;
} }
#define MS_CHANGE_TYPE_MASK \
(MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE)
static int do_new_mount(struct mount_info *mi) static int do_new_mount(struct mount_info *mi)
{ {
char *src; char *src;
...@@ -1769,7 +1772,7 @@ static int do_new_mount(struct mount_info *mi) ...@@ -1769,7 +1772,7 @@ static int do_new_mount(struct mount_info *mi)
return -1; return -1;
if (mount(src, mi->mountpoint, tp->name, if (mount(src, mi->mountpoint, tp->name,
mi->flags & (~MS_SHARED), mi->options) < 0) { mi->flags & ~MS_CHANGE_TYPE_MASK, mi->options) < 0) {
pr_perror("Can't mount at %s", mi->mountpoint); pr_perror("Can't mount at %s", mi->mountpoint);
return -1; 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