<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 10, 2014 at 12:56 PM, 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On 12/08/2014 07:25 AM, Nikolay Plotnik wrote:<br>
> From 99e31b5263ee01f177a9c02368de1610d1b807a3 Mon Sep 17 00:00:00 2001<br>
</span>> From: Nikolay Plotnik <<a href="mailto:nikolay.plotnik@gmail.com">nikolay.plotnik@gmail.com</a> <mailto:<a href="mailto:nikolay.plotnik@gmail.com">nikolay.plotnik@gmail.com</a>>><br>
<span class="">> Date: Mon, 8 Dec 2014 06:55:18 +0300<br>
> Subject: [PATCH] Add root mount point of container as irmap hint<br>
><br>
> It appears container can have some notifications on its root path /.<br>
> So irmap mechanism should handle it appropriately - without recursive walk into all filesystem tree.<br>
> For that purposes new irmap hint with path ".." is added with special nr_kids value - 0.<br>
> This value is used to identify directory from simple file.<br>
> Two dots is used instead of one because of some irmap functions need non-absolute,<br>
> relative to root path - they throw away first symbol in the hint path(/).<br>
><br>
</span>> Signed-off-by: Nikolay Plotnik <<a href="mailto:nikolay.plotnik@gmail.com">nikolay.plotnik@gmail.com</a> <mailto:<a href="mailto:nikolay.plotnik@gmail.com">nikolay.plotnik@gmail.com</a>>><br>
<span class="">><br>
> ---<br>
> irmap.c | 1 +<br>
> 1 file changed, 1 insertion(+)<br>
><br>
> diff --git a/irmap.c b/irmap.c<br>
> index 10ebb0a..c21339b 100644<br>
> --- a/irmap.c<br>
> +++ b/irmap.c<br>
> @@ -57,6 +57,7 @@ static struct irmap hints[] = {<br>
> { .path = "/etc", .nr_kids = -1, },<br>
> { .path = "/var/spool", .nr_kids = -1, },<br>
> { .path = "/lib/udev", .nr_kids = -1, },<br>
> + { .path = "..", .nr_kids = 0, },<br>
<br>
</span>Can the path be "//"? Or at least the "/." one.<br>
It would be much more understandable.<br></blockquote><div><br></div><div>Yeah, /. works fine. But I do not understand why // doesn't work.<br></div><div>110025 is fd for MNTNS_ROOT, its inode is 2891453</div><div>I add some debug output:<br></div><div><br></div><div>(00.565056) irmap: Scanning // hint<br>(00.565060) irmap: Stat for 110025: INO - 2891453, DEV - 64768<br>(00.565063) irmap: Refresh stat for //<br>(00.565067) irmap: MNTNS_ROOT: 110025, PATH: //, INO: 2, DEV: 64768<br><br></div><div>As we can see fstatat(MNTNS_ROOT, /, ...) treats / as a root for the host filesystem(inode of / is 2), not only root directory for container.<br></div><div><br></div><div>But everything is okay for /. :<br></div><div><br>(00.573051) irmap: Scanning /. hint<br>(00.573053) irmap: Stat for 110025: INO - 2891453, DEV - 64768<br>(00.573055) irmap: Refresh stat for /.<br>(00.573063) irmap: MNTNS_ROOT: 110025, PATH: /., INO: 2891453, DEV: 64768 <br><br></div><div>Patch:<br><br>From 9e25a3f6f1985559c867f90305fa7994c9d9fce2 Mon Sep 17 00:00:00 2001<br>From: Nikolay Plotnik <<a href="mailto:nikolay.plotnik@gmail.com">nikolay.plotnik@gmail.com</a>><br>Date: Thu, 11 Dec 2014 16:43:28 +0300<br>Subject: [PATCH] Add more understandable hint for root of container<br><br>---<br> irmap.c | 2 +-<br> 1 file changed, 1 insertion(+), 1 deletion(-)<br><br>diff --git a/irmap.c b/irmap.c<br>index c21339b..e099603 100644<br>--- a/irmap.c<br>+++ b/irmap.c<br>@@ -57,7 +57,7 @@ static struct irmap hints[] = {<br> { .path = "/etc", .nr_kids = -1, },<br> { .path = "/var/spool", .nr_kids = -1, },<br> { .path = "/lib/udev", .nr_kids = -1, },<br>- { .path = "..", .nr_kids = 0, },<br>+ { .path = "/.", .nr_kids = 0, },<br> { .path = "/no-such-path", .nr_kids = -1, },<br> { },<br> };<br>-- <br>1.9.3<br><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class=""><br>
> { .path = "/no-such-path", .nr_kids = -1, },<br>
> { },<br>
> };<br>
> --<br>
> 1.9.3<br>
><br>
><br>
><br>
</span>> _______________________________________________<br>
> CRIU mailing list<br>
> <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
> <a href="https://lists.openvz.org/mailman/listinfo/criu" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
><br>
<br>
</blockquote></div><br></div></div>