[CRIU] [PATCH] sk-unix: set mntinfo

Christian Brauner christian.brauner at canonical.com
Tue Sep 13 13:51:04 PDT 2016


On Tue, Sep 13, 2016 at 05:53:59PM +0300, Pavel Emelyanov wrote:
> On 09/07/2016 05:29 PM, Christian Brauner wrote:
> > phys_stat_resolve() call mount_resolve_path() which requires that mntinfo_tree
> > in the ns_id struct is initialized. This is a problem we observed with sockets
> > on btrfs volumes:
> 
> Sorry for the late response. See my comment inline.
> 
> > Signed-off-by: Christian Brauner <christian.brauner at canonical.com>
> > ---
> >  criu/sk-unix.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/criu/sk-unix.c b/criu/sk-unix.c
> > index 99f0b08..a199ca4 100644
> > --- a/criu/sk-unix.c
> > +++ b/criu/sk-unix.c
> > @@ -525,6 +525,7 @@ static int unix_process_name(struct unix_sk_desc *d, const struct unix_diag_msg
> >  			ret = -ENOENT;
> >  			goto out;
> >  		}
> > +		ns->mnt.mntinfo_tree = mntinfo;
> 
> I guess that's too late for this assignment. Since this is dump time, then
> ns->mnt.mntinfo_tree should have been initialized in collect_mntns() or
> nearby.

It is in collect_mntinfo() but it seems calling lookup_ns_by_id() in
unix_process_name() does return an ns_id but ns.mnt->mntinfo_tree is not
initialized. Is mntinfo a global that is identical for all ns_ids in the linked
list? If not how should they be initialized?

> 
> >  		mntns_root = mntns_get_root_fd(ns);
> >  		if (mntns_root < 0) {
> > 
> 


More information about the CRIU mailing list