[CRIU] [PATCH 23/37] mount: __lookup_mnt_id returns the first mi if mnt_id == -1

Andrew Vagin avagin at parallels.com
Fri Apr 18 11:00:53 PDT 2014


On Fri, Apr 18, 2014 at 07:32:40PM +0400, Pavel Emelyanov wrote:
> On 04/18/2014 06:43 PM, Andrey Vagin wrote:
> > Kernels before 3.15 doesn't show mnt_id in /proc/PID/fdinfo/X.
> > When processes are restored in a current mntns, we have only one root,
> > so here isn't matter which mount will be returned.
> > 
> > Signed-off-by: Andrey Vagin <avagin at openvz.org>
> > ---
> >  mount.c | 11 ++++++++++-
> >  1 file changed, 10 insertions(+), 1 deletion(-)
> > 
> > diff --git a/mount.c b/mount.c
> > index 62e185f..a759d79 100644
> > --- a/mount.c
> > +++ b/mount.c
> > @@ -110,9 +110,18 @@ static struct mount_info *__lookup_mnt_id(struct mount_info *list, int id)
> >  {
> >  	struct mount_info *m;
> >  
> > -	for (m = list; m != NULL; m = m->next)
> > +	for (m = list; m != NULL; m = m->next) {
> > +		/*
> > +		 * Kernel before 3.15 doesn't show mnt_id for file descriptors.
> > +		 * mnt_id isn't saved for files, if mntns isn't dumped.
> > +		 * In both these cases we have only one root, so here
> > +		 * is not matter which mount will be restured.
> > +		 */
> > +		if (id == -1)
> > +			return m;
> 
> I thought you wanted to introduce some helper for this.

Yes, I have done this:
[PATCH 30/37] mount: prepare to work without mnt_id

I forgot to drop this patch. Sorry for that.
> 
> >  		if (m->mnt_id == id)
> >  			return m;
> > +	}
> >  
> >  	return NULL;
> >  }
> > 
> 
> 


More information about the CRIU mailing list