<div dir="ltr">Hi Pavel,<div><br></div><div>Thanks for looking into this. I was out on Friday but Ying confirmed that the patch works.</div><div><br></div><div>Cheers!</div><div><br></div><div>--Saied</div><div><br></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 8, 2014 at 4:51 AM, Pavel Emelyanov <span dir="ltr"><<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 07/19/2014 09:16 AM, Saied Kazemi wrote:<br>
> Hi Pavel,<br>
><br>
> 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.<br>
><br>
> 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.<br>
><br>
> 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.<br>
><br>
> 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.<br>
<br>
</div>It looks like criu constantly postpones external bind mounts. I'm trying to resolve<br>
when we manage to break this (when I did ext-mount-map they for some reason didn't).<br>
Meanwhile, this patch fixes it back:<br>
<br>
diff --git a/mount.c b/mount.c<br>
index e0e88ea..60e14d1 100644<br>
--- a/mount.c<br>
+++ b/mount.c<br>
@@ -1380,9 +1380,9 @@ static bool can_mount_now(struct mount_info *mi)<br>
/*<br>
* Other mounts can be mounted only if they have<br>
* the master mount (see propagate_mount) or if we<br>
- * expect a plugin to help us.<br>
+ * expect a plugin/ext-mount-map to help us.<br>
*/<br>
- if (mi->bind || mi->need_plugin)<br>
+ if (mi->bind || mi->need_plugin || mi->external)<br>
return true;<br>
<br>
return false;<br>
@@ -1415,7 +1415,7 @@ static int do_mount_one(struct mount_info *mi)<br>
<br>
if (!mi->parent)<br>
ret = do_mount_root(mi);<br>
- else if (!mi->bind && !mi->need_plugin)<br>
+ else if (!mi->bind && !mi->need_plugin && !mi->external)<br>
ret = do_new_mount(mi);<br>
else<br>
ret = do_bind_mount(mi);<br>
<br>
Can you confirm that it fixes your problem?<br>
<br>
Thanks,<br>
Pavel<br>
<br>
</blockquote></div><br></div>