[CRIU] [PATCH 4/4] mount: handle old images where sb and mnt options were not separated
Pavel Emelyanov
xemul at parallels.com
Thu Aug 13 08:32:05 PDT 2015
On 08/11/2015 06:33 PM, Andrey Vagin wrote:
> 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.
>
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
> mount.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/mount.c b/mount.c
> index 4589399..06b5399 100644
> --- a/mount.c
> +++ b/mount.c
> @@ -2335,6 +2335,15 @@ 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) {
Need a comment here saying that in old images flags was effectively
sb_flags and if absent we just ... $do_what_we_do_here :)
> + unsigned int mflags = MS_SHARED | MS_PRIVATE |
> + MS_SLAVE | MS_UNBINDABLE |
> + MS_NOSUID | MS_NODEV | MS_NOEXEC |
> + MS_NOATIME | MS_NODIRATIME | MS_RELATIME;
> +
> + 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;
>
More information about the CRIU
mailing list