Commit 84cc1e12 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

mount: don't merge mnt and sb flags if only one contains MS_RDONLY

Reported-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarAndrew Vagin <avagin@openvz.org>
Tested-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9353051b
......@@ -1958,15 +1958,15 @@ static int do_new_mount(struct mount_info *mi)
if (!src)
return -1;
if (remount_ro)
sflags &= ~MS_RDONLY;
/* Merge superblock and mount flags if it's posiable */
if (!(mflags & ~MS_MNT_KNOWN_FLAGS) && ((sflags ^ mflags) & MS_RDONLY)) {
if (!(mflags & ~MS_MNT_KNOWN_FLAGS) && !((sflags ^ mflags) & MS_RDONLY)) {
sflags |= mflags;
mflags = 0;
}
if (remount_ro)
sflags &= ~MS_RDONLY;
if (mount(src, mi->mountpoint, tp->name, sflags, mi->options) < 0) {
pr_perror("Can't mount at %s", 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