[CRIU] Re: [PATCH 2/2] tty: Add checkpoint/restore for ttys

Cyrill Gorcunov gorcunov at openvz.org
Thu Jun 21 08:29:05 EDT 2012


On Thu, Jun 21, 2012 at 04:22:03PM +0400, Andrew Vagin wrote:
> On Thu, Jun 21, 2012 at 02:59:28PM +0400, Cyrill Gorcunov wrote:
> > On Thu, Jun 21, 2012 at 02:46:56PM +0400, Andrew Vagin wrote:
> > >
> > > Looks like that it should be dead-locked if slave and master will be
> > > opened in one process and a descriptor number of slave will be less than
> > > a number of master.
> > 
> > How it's possible? If slave get connected from another process then it
> > means the fd is sent via scm. Or you mean the case of multiple slaves
> > opening from another process?
> I said nothing about another processes. Let's imagine, that we have one
> process.
> slave_fd = 1
> master_fd = 2

Thus you mean the case where slave-fd get the number less than master_fd
and get tried to receive fd via scm while mister fd is not yet even created.

This is resolved via partial ordering in

+		switch (info->major) {
+		case TTYAUX_MAJOR:
+			list_add(&info->list, &all_ttys);
+			break;
+		case UNIX98_PTY_SLAVE_MAJOR:
+			list_add_tail(&info->list, &all_ttys);
+			break;

if only I've not missed something obvious.

	Cyrill


More information about the CRIU mailing list