[CRIU] Restore Failure

Pavel Emelyanov xemul at parallels.com
Tue Aug 12 03:31:10 PDT 2014


On 08/11/2014 08:36 PM, Saied Kazemi wrote:
> Hi Pavel,
> 
> Thanks for looking into this.  I was out on Friday but Ying confirmed that the patch works.

Thanks, Saied! I've applied the patch, it's now in the git head.

> Cheers!
> 
> --Saied
> 
> 
> 
> On Fri, Aug 8, 2014 at 4:51 AM, Pavel Emelyanov <xemul at parallels.com <mailto:xemul at parallels.com>> wrote:
> 
>     On 07/19/2014 09:16 AM, Saied Kazemi wrote:
>     > Hi Pavel,
>     >
>     > I have run into a problem when restoring a process that was running in a Docker container when Docker home is bind mounted from a different device.
>     >
>     > As you know, it is possible to successfully dump and restore Docker container processes.  But when /var/lib/docker is bind mounted from a different device (e.g., mount /dev/sd3a /mnt/sd3a; mkdir /mnt/sda3/docker; mount --bind /mnt/sda3/docker /var/lib/docker), dump succeeds but restore fails.
>     >
>     > For easier testing and debugging, I have reproduced the problem with a couple of small shell scripts that I have attached here. These are the same shell scripts that I used during external bind mount troubleshooting.  I just changed them a bit to illustrate the problem I am currently running into.  If you run ./z1.sh without the bindmount argument, everything works fine.  But if you specify bindmount, it bind mounts its root from a different device (a tmpfs in this case), dump succeeds but restore fails.  I hope it's not an error on my part.
>     >
>     > I have been using the latest greatest criu binary from the head.  Please let me know once you've had a chance to try this.
> 
>     It looks like criu constantly postpones external bind mounts. I'm trying to resolve
>     when we manage to break this (when I did ext-mount-map they for some reason didn't).
>     Meanwhile, this patch fixes it back:
> 
>     diff --git a/mount.c b/mount.c
>     index e0e88ea..60e14d1 100644
>     --- a/mount.c
>     +++ b/mount.c
>     @@ -1380,9 +1380,9 @@ static bool can_mount_now(struct mount_info *mi)
>             /*
>              * Other mounts can be mounted only if they have
>              * the master mount (see propagate_mount) or if we
>     -        * expect a plugin to help us.
>     +        * expect a plugin/ext-mount-map to help us.
>              */
>     -       if (mi->bind || mi->need_plugin)
>     +       if (mi->bind || mi->need_plugin || mi->external)
>                     return true;
> 
>             return false;
>     @@ -1415,7 +1415,7 @@ static int do_mount_one(struct mount_info *mi)
> 
>             if (!mi->parent)
>                     ret = do_mount_root(mi);
>     -       else if (!mi->bind && !mi->need_plugin)
>     +       else if (!mi->bind && !mi->need_plugin && !mi->external)
>                     ret = do_new_mount(mi);
>             else
>                     ret = do_bind_mount(mi);
> 
>     Can you confirm that it fixes your problem?
> 
>     Thanks,
>     Pavel
> 
> 



More information about the CRIU mailing list