Commit 5cff834a authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

mount: handle old images where sb and mnt options were not separated (v3)

Currently we have only one common flag. It is MS_READONLY and it's
interpreted as a super block flag to not change old behaviour.

v2: add a comment
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 1174a2ad
......@@ -2400,6 +2400,20 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
pm->s_dev = me->root_dev;
pm->flags = me->flags;
pm->sb_flags = me->sb_flags;
if (!me->has_sb_flags) {
const unsigned int mflags = MS_SHARED | MS_PRIVATE |
MS_SLAVE | MS_UNBINDABLE |
MS_NOSUID | MS_NODEV | MS_NOEXEC |
MS_NOATIME | MS_NODIRATIME | MS_RELATIME;
/*
* In old images mnt and sb flags are saved together.
* Here we separate them and save the old logic about MS_RDONLY.
*/
pm->sb_flags = pm->flags & ~mflags;
pm->flags = pm->flags & mflags;
}
pm->shared_id = me->shared_id;
pm->master_id = me->master_id;
pm->need_plugin = me->with_plugin;
......
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