[CRIU] [PATCH 5/7] tty: Add support for multiple devpts instances

Cyrill Gorcunov gorcunov at gmail.com
Wed Feb 8 07:57:35 PST 2017


On Wed, Feb 08, 2017 at 11:41:27AM +0300, Pavel Emelyanov wrote:
> > +
> > +	namelen = strlen(mi->ns_mountpoint) + 64;
> 
> Why 64?

To fit /dev/pts/%u format at least.

> > @@ -493,6 +521,7 @@ static struct file_desc *pty_alloc_reg(struct tty_info *info, bool add)
> >  	r->rfe->id	= tfe->id;
> >  	r->rfe->flags	= tfe->flags;
> >  	r->rfe->fown	= tfe->fown;
> > +	r->rfe->mnt_id	= mi->mnt_id;
> 
> Runaway from prev patch(es)?

No.
> >  
> > -	orig = container_of(info->reg_d, struct reg_file_info, d);
> > -	new = container_of(fake_desc, struct reg_file_info, d);
> > +	rfi = container_of(info->reg_d, struct reg_file_info, d);
> > +	pr_debug("Allocating fake descriptor for %#x (path %s, invert_peer %d)\n",
> > +		 info->tfe->id, rfi->path, invert_peer);
> 
> Please, don't restructure the code flow or improve logging just because "while I'm at it".

It's not restructurisation, it's compelte redesign, we use mountpoints now
instead of hardcoded pathes.
> 
> Wow! Why does this whole branch goes away? This doesn't fit "we just need
> to add mnt_id matching checks" in the patch comment.

See above, we switched to mnt_id.

	Cyrill


More information about the CRIU mailing list