[CRIU] [PATCH 08/14] mounts: mntns_collect_root in __open_mountpoint

Andrew Vagin avagin at parallels.com
Fri Apr 18 02:19:10 PDT 2014


On Fri, Apr 18, 2014 at 12:39:24PM +0400, Pavel Emelyanov wrote:
> On 04/17/2014 11:24 PM, Andrey Vagin wrote:
> > We are going to support nested mount namespaces,
> > file descriptors can be from different namespaces,
> > so a namespace root must be updated for each of them.
> > 
> > Signed-off-by: Andrey Vagin <avagin at openvz.org>
> > ---
> >  mount.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/mount.c b/mount.c
> > index 39e6bcc..53eec0d 100644
> > --- a/mount.c
> > +++ b/mount.c
> > @@ -497,7 +497,9 @@ static int __open_mountpoint(struct mount_info *pm, int mnt_fd)
> >  	if (mnt_fd == -1) {
> >  		int mntns_root;
> >  
> > -		mntns_root = get_service_fd(ROOT_FD_OFF);
> 
> What will be the point in having ROOT service FD then?

[PATCH 14/14] mount: don't open the same root twise

> 
> > +		mntns_root = mntns_collect_root(pm->nsid->pid);
> > +		if (mntns_root < 0)
> > +			return -1;
> >  
> >  		/* paths starts from "." on restore and "/" on dump */
> >  		mnt_fd = openat(mntns_root, pm->mountpoint, O_RDONLY);
> > 
> 
> 


More information about the CRIU mailing list