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