<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 27, 2016 at 1:39 AM, Andrew Vagin <span dir="ltr"><<a target="_blank" href="mailto:avagin@virtuozzo.com">avagin@virtuozzo.com</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div class="gmail-HOEnZb"><div class="gmail-h5">On Tue, Jul 26, 2016 at 04:15:35PM +0300, Pavel Emelyanov wrote:<br>
> On 07/26/2016 01:42 AM, Andrew Vagin wrote:<br>
> > On Mon, Jul 25, 2016 at 02:26:01PM +0000, Katerina Koukiou wrote:<br>
> >> When using --root option in criu dump, when the mountpoint passed<br>
> >> contains a symbolic link, criu does not resolve its parent correctly.<br>
> >> e.g when passing --root /run/rootfs, dump finishes successfully;<br>
> >> but when /var/run/rootfs is passed, where /var/run is symbolic link to<br>
> >> /run it exits with error "New root and old root are the same".<br>
> >><br>
> >> Signed-off-by: Katerina Koukiou <<a href="mailto:k.koukiou@gmail.com">k.koukiou@gmail.com</a>><br>
> >> ---<br>
> >> criu/mount.c | 10 +++++++++-<br>
> >> 1 file changed, 9 insertions(+), 1 deletion(-)<br>
> >><br>
> >> diff --git a/criu/mount.c b/criu/mount.c<br>
> >> index 7c280c0..0cd83af 100644<br>
> >> --- a/criu/mount.c<br>
> >> +++ b/criu/mount.c<br>
> >> @@ -3420,6 +3420,8 @@ int prepare_mnt_ns(void)<br>
> >> return -1;<br>
> >> } else {<br>
> >> struct mount_info *mi;<br>
> >> + char *ret;<br>
> >> + char path[PATH_MAX + 1];<br>
> ><br>
> > PATH_MAX is enough, it includes '\0'<br>
> >><br>
> >> /*<br>
> >> * The whole tree of mountpoints is to be moved into one<br>
> >> @@ -3428,8 +3430,14 @@ int prepare_mnt_ns(void)<br>
> >> * with a single umount call later.<br>
> >> */<br>
> >><br>
> >> + ret = realpath(opts.root, path);<br>
> ><br>
> > realpath returns a string, but a type of ret is int.<br>
><br>
> No, there's new char *ret in this block :)<br>
<br>
</div></div>Sorry, I haven't noticed this. Thanks.<br></blockquote><div><br></div><div>It's ugly indeed. I can send a v2 without using ret for the check if needed.<br></div><div>Btw, any idea why the test suite currently fails on zdtm/static/helper_zombie_child<br>test on restore?<br></div><div><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<div class="gmail-HOEnZb"><div class="gmail-h5">><br>
> >> + if (!ret) {<br>
> >> + pr_err("Unable to find real path for %s\n", opts.root);<br>
> >> + return -1;<br>
> >> + }<br>
> >> +<br>
> >> /* moving a mount residing under a shared mount is invalid. */<br>
> >> - mi = mount_resolve_path(ns.mnt.mntinfo_tree, opts.root);<br>
> >> + mi = mount_resolve_path(ns.mnt.mntinfo_tree, path);<br>
> >> if (mi == NULL) {<br>
> >> pr_err("Unable to find mount point for %s\n", opts.root);<br>
> >> return -1;<br>
> >> --<br>
> >> 2.7.3<br>
> >><br>
> >> _______________________________________________<br>
> >> CRIU mailing list<br>
> >> <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
> >> <a target="_blank" rel="noreferrer" href="https://lists.openvz.org/mailman/listinfo/criu">https://lists.openvz.org/mailman/listinfo/criu</a><br>
> > _______________________________________________<br>
> > CRIU mailing list<br>
> > <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
> > <a target="_blank" rel="noreferrer" href="https://lists.openvz.org/mailman/listinfo/criu">https://lists.openvz.org/mailman/listinfo/criu</a><br>
> > .<br>
> ><br>
><br>
</div></div></blockquote></div><br></div></div>